{"id":1045221,"date":"2024-12-31T13:21:16","date_gmt":"2024-12-31T05:21:16","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1045221.html"},"modified":"2024-12-31T13:21:38","modified_gmt":"2024-12-31T05:21:38","slug":"python%e5%a6%82%e4%bd%95%e5%86%99%e5%85%a5excel%e6%96%87%e4%bb%b6%e6%a0%bc%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1045221.html","title":{"rendered":"python\u5982\u4f55\u5199\u5165excel\u6587\u4ef6\u683c\u5f0f"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/bfc7f937-ec10-4658-bc2c-516a15bd0a6f.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u5982\u4f55\u5199\u5165excel\u6587\u4ef6\u683c\u5f0f\" \/><\/p>\n<p><p> Python\u5199\u5165Excel\u6587\u4ef6\u683c\u5f0f\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5e38\u7528\u7684\u5e93\u6709pandas\u3001openpyxl\u548cxlsxwriter\u7b49\u3002<strong>\u4f7f\u7528pandas\u5e93\u8fdb\u884c\u6570\u636e\u5904\u7406\u3001\u4f7f\u7528openpyxl\u5e93\u8fdb\u884cExcel\u6587\u4ef6\u8bfb\u5199\u3001\u4f7f\u7528xlsxwriter\u5e93\u8fdb\u884cExcel\u6587\u4ef6\u683c\u5f0f\u5316<\/strong>\u662f\u5176\u4e2d\u8f83\u4e3a\u5e38\u89c1\u7684\u65b9\u6cd5\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528pandas\u3001openpyxl\u548cxlsxwriter\u5e93\u6765\u5199\u5165Excel\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u5b89\u88c5\u6240\u9700\u5e93<\/h2>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u786e\u4fdd\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86\u6240\u9700\u7684Python\u5e93\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pandas openpyxl xlsxwriter<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e8c\u3001\u4f7f\u7528Pandas\u5e93\u5199\u5165Excel\u6587\u4ef6<\/h2>\n<\/p>\n<p><p>Pandas\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u5e93\uff0c\u80fd\u591f\u8f7b\u677e\u5904\u7406\u8868\u683c\u6570\u636e\uff0c\u5e76\u5c06\u5176\u5199\u5165Excel\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h3>1\u3001\u521b\u5efaDataFrame<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2aDataFrame\uff0c\u8fd9\u662fPandas\u7528\u4e8e\u6570\u636e\u5904\u7406\u7684\u4e3b\u8981\u6570\u636e\u7ed3\u6784\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684DataFrame<\/strong><\/h2>\n<p>data = {<\/p>\n<p>    &#39;Name&#39;: [&#39;Alice&#39;, &#39;Bob&#39;, &#39;Charlie&#39;],<\/p>\n<p>    &#39;Age&#39;: [25, 30, 35],<\/p>\n<p>    &#39;City&#39;: [&#39;New York&#39;, &#39;Los Angeles&#39;, &#39;Chicago&#39;]<\/p>\n<p>}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2\u3001\u5199\u5165Excel\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528<code>to_excel<\/code>\u65b9\u6cd5\u5c06DataFrame\u5199\u5165Excel\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5c06DataFrame\u5199\u5165Excel\u6587\u4ef6<\/p>\n<p>df.to_excel(&#39;output.xlsx&#39;, index=False)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u91cc\uff0c<code>index=False<\/code>\u53c2\u6570\u7528\u4e8e\u907f\u514d\u5c06DataFrame\u7684\u7d22\u5f15\u5199\u5165Excel\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h3>3\u3001\u8bbe\u7f6e\u5de5\u4f5c\u8868\u540d\u79f0<\/h3>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u901a\u8fc7<code>sheet_name<\/code>\u53c2\u6570\u6307\u5b9a\u5de5\u4f5c\u8868\u540d\u79f0\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">df.to_excel(&#39;output.xlsx&#39;, index=False, sheet_name=&#39;Sheet1&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4\u3001\u683c\u5f0f\u5316\u5217\u5bbd<\/h3>\n<\/p>\n<p><p>\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528openpyxl\u5e93\u6765\u683c\u5f0f\u5316\u5217\u5bbd\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">with pd.ExcelWriter(&#39;output.xlsx&#39;, engine=&#39;openpyxl&#39;) as writer:<\/p>\n<p>    df.to_excel(writer, index=False, sheet_name=&#39;Sheet1&#39;)<\/p>\n<p>    workbook = writer.book<\/p>\n<p>    worksheet = writer.sheets[&#39;Sheet1&#39;]<\/p>\n<p>    for column in worksheet.columns:<\/p>\n<p>        max_length = 0<\/p>\n<p>        column = [cell for cell in column]<\/p>\n<p>        for cell in column:<\/p>\n<p>            try:<\/p>\n<p>                if len(str(cell.value)) &gt; max_length:<\/p>\n<p>                    max_length = len(cell.value)<\/p>\n<p>            except:<\/p>\n<p>                pass<\/p>\n<p>        adjusted_width = (max_length + 2)<\/p>\n<p>        worksheet.column_dimensions[column[0].column_letter].width = adjusted_width<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e09\u3001\u4f7f\u7528Openpyxl\u5e93\u5199\u5165Excel\u6587\u4ef6<\/h2>\n<\/p>\n<p><p>Openpyxl\u662f\u4e00\u4e2a\u4e13\u95e8\u7528\u4e8e\u8bfb\u5199Excel\u6587\u4ef6\u7684\u5e93\uff0c\u529f\u80fd\u975e\u5e38\u5f3a\u5927\uff0c\u9002\u7528\u4e8e\u9700\u8981\u8fdb\u884c\u590d\u6742Excel\u64cd\u4f5c\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h3>1\u3001\u521b\u5efaWorkbook\u5bf9\u8c61<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u521b\u5efa\u4e00\u4e2aWorkbook\u5bf9\u8c61\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from openpyxl import Workbook<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2aWorkbook\u5bf9\u8c61<\/strong><\/h2>\n<p>wb = Workbook()<\/p>\n<p>ws = wb.active<\/p>\n<p>ws.title = &quot;Sheet1&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2\u3001\u5199\u5165\u6570\u636e<\/h3>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u53ef\u4ee5\u9010\u884c\u5199\u5165\u6570\u636e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5199\u5165\u6570\u636e<\/p>\n<p>data = [<\/p>\n<p>    [&#39;Name&#39;, &#39;Age&#39;, &#39;City&#39;],<\/p>\n<p>    [&#39;Alice&#39;, 25, &#39;New York&#39;],<\/p>\n<p>    [&#39;Bob&#39;, 30, &#39;Los Angeles&#39;],<\/p>\n<p>    [&#39;Charlie&#39;, 35, &#39;Chicago&#39;]<\/p>\n<p>]<\/p>\n<p>for row in data:<\/p>\n<p>    ws.append(row)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3\u3001\u4fdd\u5b58Excel\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u6700\u540e\uff0c\u4fdd\u5b58Excel\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4fdd\u5b58Excel\u6587\u4ef6<\/p>\n<p>wb.save(&#39;output_openpyxl.xlsx&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4\u3001\u8bbe\u7f6e\u5355\u5143\u683c\u6837\u5f0f<\/h3>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u4f7f\u7528openpyxl\u63d0\u4f9b\u7684\u6837\u5f0f\u529f\u80fd\u6765\u8bbe\u7f6e\u5355\u5143\u683c\u6837\u5f0f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from openpyxl.styles import Font, Alignment<\/p>\n<h2><strong>\u8bbe\u7f6e\u5355\u5143\u683c\u6837\u5f0f<\/strong><\/h2>\n<p>header_font = Font(bold=True)<\/p>\n<p>center_alignment = Alignment(horizontal=&#39;center&#39;)<\/p>\n<p>for cell in ws[&quot;1:1&quot;]:<\/p>\n<p>    cell.font = header_font<\/p>\n<p>    cell.alignment = center_alignment<\/p>\n<h2><strong>\u4fdd\u5b58Excel\u6587\u4ef6<\/strong><\/h2>\n<p>wb.save(&#39;output_openpyxl_styled.xlsx&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u56db\u3001\u4f7f\u7528XlsxWriter\u5e93\u5199\u5165Excel\u6587\u4ef6<\/h2>\n<\/p>\n<p><p>XlsxWriter\u662f\u4e00\u4e2a\u4e13\u95e8\u7528\u4e8e\u5199\u5165Excel\u6587\u4ef6\u7684\u5e93\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u683c\u5f0f\u5316\u9009\u9879\uff0c\u9002\u7528\u4e8e\u9700\u8981\u9ad8\u5ea6\u81ea\u5b9a\u4e49\u683c\u5f0f\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h3>1\u3001\u521b\u5efaWorkbook\u5bf9\u8c61<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u521b\u5efa\u4e00\u4e2aWorkbook\u5bf9\u8c61\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import xlsxwriter<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2aWorkbook\u5bf9\u8c61<\/strong><\/h2>\n<p>workbook = xlsxwriter.Workbook(&#39;output_xlsxwriter.xlsx&#39;)<\/p>\n<p>worksheet = workbook.add_worksheet(&#39;Sheet1&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2\u3001\u5199\u5165\u6570\u636e<\/h3>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u53ef\u4ee5\u9010\u884c\u5199\u5165\u6570\u636e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5199\u5165\u6570\u636e<\/p>\n<p>data = [<\/p>\n<p>    [&#39;Name&#39;, &#39;Age&#39;, &#39;City&#39;],<\/p>\n<p>    [&#39;Alice&#39;, 25, &#39;New York&#39;],<\/p>\n<p>    [&#39;Bob&#39;, 30, &#39;Los Angeles&#39;],<\/p>\n<p>    [&#39;Charlie&#39;, 35, &#39;Chicago&#39;]<\/p>\n<p>]<\/p>\n<p>row = 0<\/p>\n<p>col = 0<\/p>\n<p>for name, age, city in data:<\/p>\n<p>    worksheet.write(row, col, name)<\/p>\n<p>    worksheet.write(row, col + 1, age)<\/p>\n<p>    worksheet.write(row, col + 2, city)<\/p>\n<p>    row += 1<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3\u3001\u8bbe\u7f6e\u5355\u5143\u683c\u683c\u5f0f<\/h3>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u4f7f\u7528XlsxWriter\u63d0\u4f9b\u7684\u683c\u5f0f\u529f\u80fd\u6765\u8bbe\u7f6e\u5355\u5143\u683c\u683c\u5f0f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u683c\u5f0f\u5bf9\u8c61<\/p>\n<p>header_format = workbook.add_format({&#39;bold&#39;: True, &#39;align&#39;: &#39;center&#39;})<\/p>\n<h2><strong>\u8bbe\u7f6e\u5355\u5143\u683c\u683c\u5f0f<\/strong><\/h2>\n<p>worksheet.set_row(0, None, header_format)<\/p>\n<h2><strong>\u8bbe\u7f6e\u5217\u5bbd<\/strong><\/h2>\n<p>worksheet.set_column(&#39;A:A&#39;, 20)<\/p>\n<p>worksheet.set_column(&#39;B:B&#39;, 10)<\/p>\n<p>worksheet.set_column(&#39;C:C&#39;, 20)<\/p>\n<h2><strong>\u4fdd\u5b58Excel\u6587\u4ef6<\/strong><\/h2>\n<p>workbook.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e94\u3001\u603b\u7ed3<\/h2>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528Pandas\u3001Openpyxl\u548cXlsxWriter\u5e93\u5206\u522b\u5b8c\u6210Excel\u6587\u4ef6\u7684\u5199\u5165\u64cd\u4f5c\u3002\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5e93\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>Pandas<\/strong>\uff1a\u9002\u7528\u4e8e\u6570\u636e\u5904\u7406\u548c\u5206\u6790\uff0c\u5feb\u901f\u5199\u5165Excel\u6587\u4ef6\u3002<\/li>\n<li><strong>Openpyxl<\/strong>\uff1a\u9002\u7528\u4e8e\u9700\u8981\u590d\u6742Excel\u64cd\u4f5c\u7684\u573a\u666f\uff0c\u5982\u683c\u5f0f\u8bbe\u7f6e\u3001\u5355\u5143\u683c\u5408\u5e76\u7b49\u3002<\/li>\n<li><strong>XlsxWriter<\/strong>\uff1a\u9002\u7528\u4e8e\u9700\u8981\u9ad8\u5ea6\u81ea\u5b9a\u4e49\u683c\u5f0f\u7684\u573a\u666f\uff0c\u63d0\u4f9b\u4e30\u5bcc\u7684\u683c\u5f0f\u5316\u9009\u9879\u3002<\/li>\n<\/ul>\n<p><p>\u5e0c\u671b\u8fd9\u4e9b\u5185\u5bb9\u80fd\u5e2e\u4f60\u66f4\u597d\u5730\u4f7f\u7528Python\u5199\u5165Excel\u6587\u4ef6\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5199\u5165Excel\u6587\u4ef6\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u5199\u5165Excel\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u5e93\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u662f<code>pandas<\/code>\u548c<code>openpyxl<\/code>\u3002\u4f7f\u7528<code>pandas<\/code>\u5e93\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06\u6570\u636e\u6846\u5199\u5165Excel\u6587\u4ef6\uff0c\u800c\u4f7f\u7528<code>openpyxl<\/code>\u53ef\u4ee5\u5bf9Excel\u6587\u4ef6\u8fdb\u884c\u66f4\u7ec6\u81f4\u7684\u63a7\u5236\uff0c\u6bd4\u5982\u8bbe\u7f6e\u5355\u5143\u683c\u6837\u5f0f\u6216\u5904\u7406\u516c\u5f0f\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>pandas<\/code>\u7684\u7b80\u5355\u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-python\">import pandas as pd\n\ndata = {\n    &#39;\u59d3\u540d&#39;: [&#39;\u5f20\u4e09&#39;, &#39;\u674e\u56db&#39;, &#39;\u738b\u4e94&#39;],\n    &#39;\u5e74\u9f84&#39;: [28, 34, 23]\n}\n\ndf = pd.DataFrame(data)\ndf.to_excel(&#39;output.xlsx&#39;, index=False)\n<\/code><\/pre>\n<p>\u8be5\u4ee3\u7801\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>output.xlsx<\/code>\u7684Excel\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u4e24\u5217\u6570\u636e\u3002<\/p>\n<p><strong>Python\u4e2d\u5199\u5165Excel\u6587\u4ef6\u9700\u8981\u5b89\u88c5\u54ea\u4e9b\u5e93\uff1f<\/strong><br \/>\u5728\u8fdb\u884cExcel\u6587\u4ef6\u5199\u5165\u64cd\u4f5c\u4e4b\u524d\uff0c\u786e\u4fdd\u60a8\u7684\u73af\u5883\u4e2d\u5b89\u88c5\u4e86\u6240\u9700\u7684\u5e93\u3002\u5bf9\u4e8e\u4f7f\u7528<code>pandas<\/code>\uff0c\u60a8\u9700\u8981\u5b89\u88c5<code>pandas<\/code>\u548c<code>openpyxl<\/code>\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<pre><code>pip install pandas openpyxl\n<\/code><\/pre>\n<p>\u5982\u679c\u60a8\u9700\u8981\u8fdb\u884c\u66f4\u590d\u6742\u7684Excel\u6587\u4ef6\u64cd\u4f5c\uff0c\u8003\u8651\u4f7f\u7528<code>xlrd<\/code>\u548c<code>xlsxwriter<\/code>\u8fd9\u4e24\u4e2a\u5e93\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u5199\u5165Excel\u6587\u4ef6\u65f6\u7684\u6587\u4ef6\u8986\u76d6\u95ee\u9898\uff1f<\/strong><br \/>\u5728\u4f7f\u7528Python\u5199\u5165Excel\u6587\u4ef6\u65f6\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u76ee\u6807\u6587\u4ef6\u5df2\u5b58\u5728\uff0c\u5219\u4f1a\u88ab\u8986\u76d6\u3002\u4e3a\u4e86\u907f\u514d\u6570\u636e\u4e22\u5931\uff0c\u60a8\u53ef\u4ee5\u5728\u5199\u5165\u4e4b\u524d\u68c0\u67e5\u6587\u4ef6\u662f\u5426\u5b58\u5728\uff0c\u6216\u8005\u4f7f\u7528\u5176\u4ed6\u6587\u4ef6\u540d\u3002\u53ef\u4ee5\u4f7f\u7528<code>os<\/code>\u5e93\u68c0\u67e5\u6587\u4ef6\u662f\u5426\u5b58\u5728\uff1a<\/p>\n<pre><code class=\"language-python\">import os\n\nfile_name = &#39;output.xlsx&#39;\nif os.path.exists(file_name):\n    print(f&quot;{file_name} \u5df2\u5b58\u5728\uff0c\u8bf7\u9009\u62e9\u5176\u4ed6\u6587\u4ef6\u540d\u3002&quot;)\nelse:\n    df.to_excel(file_name, index=False)\n<\/code><\/pre>\n<p>\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u4e0d\u4f1a\u610f\u5916\u8986\u76d6\u5df2\u6709\u6587\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u5199\u5165Excel\u6587\u4ef6\u683c\u5f0f\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5e38\u7528\u7684\u5e93\u6709pandas\u3001openpyxl\u548cxlsxwriter [&hellip;]","protected":false},"author":3,"featured_media":1045265,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1045221"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1045221"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1045221\/revisions"}],"predecessor-version":[{"id":1045268,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1045221\/revisions\/1045268"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1045265"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1045221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1045221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1045221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}