{ "info": { "author": "Junjie Qiu", "author_email": "xiaohaixie@qq.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7" ], "description": "## \u9879\u76ee\u63cf\u8ff0\n\u6839\u636e\u7279\u5b9a\u683c\u5f0f\u7684Excel\u6a21\u7248\uff0c\u901a\u8fc7\u586b\u5145\u6570\u636e\u751f\u6210\u5b9e\u9645\u7684Excel\u6587\u4ef6\u3002\n\u5b9e\u9645\u6587\u4ef6\u4e2d\u7684\u5355\u5143\u683c\u6837\u5f0f\uff0c\u5b8c\u5168\u4ece\u6a21\u7248\u6587\u4ef6\u4e2d\u590d\u5236\u8fc7\u6765\u3002\n\u7701\u53bb\u4e86\u4ee3\u7801\u5b9a\u4e49\u5355\u5143\u683c\u6837\u5f0f\u7684\u8fc7\u7a0b\uff0c\u7b80\u5316\u4e86\u5f00\u53d1\u548c\u7ef4\u62a4\u3002\n\n## \u5b89\u88c5\n```javascript\n pip install excel-template\n```\n\u540c\u65f6\u9700\u8981\u5b89\u88c5\n```javascript\n pip install openpyxl>=2.5.0\n```\n\n## \u793a\u4f8b\u4ee3\u7801\n```javascript\n import os\n from excel_template import Writer\n\n template_path = os.path.join(\n ENV['root'], 'template', 'XXX_template.xlsx')\n output_file_path = os.path.join(\n ENV['root'], 'output', 'XXX.xlsx')\n # Sheet1\u4e3a\u6a21\u7248\u6240\u5728\u7684Sheet\u540d\u79f0\n excel_writer = Writer(template_path, 'Sheet1', output_file_path)\n\n data = XXXModule().get_XXX_data()\n if isinstance(data, dict):\n excel_writer.set_data(data)\n elif isinstance(data, list):\n excel_writer.set_data(data, multi_sheet=True)\n else:\n raise Exception(\n '\u5982\u679c\u751f\u6210\u5355Sheet\u7684Excel\u6587\u4ef6\uff0cdata\u7684\u683c\u5f0f\u5fc5\u987b\u4e3adict' + \n '\u5982\u679c\u751f\u6210\u591aSheet\u7684Excel\u6587\u4ef6\uff0cdata\u7684\u683c\u5f0f\u5fc5\u987b\u4e3alist' +\n '\u5176\u4e2d\uff0clist\u7684\u6bcf\u4e2a\u6570\u636e\u6210\u5458\uff0c\u6e32\u67d3\u4e00\u4e2aSheet')\n```\n\n## \u6a21\u7248\u7684\u4f7f\u7528\u89c4\u5219\n* \u793a\u4f8b\u6a21\u7248\uff1a(\u770b\u4e0d\u6e05\u56fe\u7247\uff0c\u8bf7\u53f3\u952e\uff0c\u70b9\u51fb\u5728\u65b0\u6807\u7b7e\u9875\u4e2d\u6253\u5f00\u56fe\u7247)\n![image](https://raw.githubusercontent.com/qjjayy/excel_template/master/image/example_template.jpeg)\n\n* \u5bf9\u5e94\u7684\u586b\u5145\u6570\u636e\u5982\u4e0b\uff1a\n```javascript\n data = {\n 'company_name': 'ExampleName',\n 'company_address': 'ExampleAddress',\n 'company_contact': 'ExampleContact',\n 'dport_and_country': 'Melbourne Airport, Australia',\n 'aport_and_country': 'Shanghai Airport, China',\n 'logsitics_no': 'L122212',\n 'create_time': '2019-01-31',\n 'containers': [\n {\n 'pallet_no': '---',\n 'carton_no': '1',\n 'sku_no': '',\n 'hs_code': '',\n 'description_cn': '',\n 'description_en': '',\n 'description_note': '',\n 'qty': '',\n 'net_weight': 16.027,\n 'gross_weight': 1,\n 'length': 1,\n 'width': 1,\n 'height': 1,\n 'pallet_type': 'N/A'\n },\n {\n 'pallet_no': '',\n 'carton_no': '',\n 'sku_no': '35536633',\n 'hs_code': '43545545',\n 'description_cn': '\u81ea\u7136\u88f8\u5986\u5047\u776b\u6bdb',\n 'description_en': 'Gurley mix',\n 'description_note': '',\n 'qty': 3,\n 'net_weight': 5.211,\n 'gross_weight': '',\n 'length': '',\n 'width': '',\n 'height': '',\n 'pallet_type': ''\n }\n ],\n 'pallet_count': 0,\n 'carton_count': 1,\n 'total_qty': 3,\n 'total_net_weight': 16.027,\n 'total_gross_weight': 1,\n 'total_volume': 1\n }\n```\n* \u6e32\u67d3\u7684\u7ed3\u679c\u5982\u4e0b\u56fe\u6240\u793a\uff1a\n![image](https://raw.githubusercontent.com/qjjayy/excel_template/master/image/example_real.jpeg)\n* \u6ce8\u610f\u4e8b\u9879\uff1a\n * \u5168\u8868\u652f\u6301\u6a2a\u5411\u5408\u5e76\u5355\u5143\u683c\n * \u53ea\u6709\u8868\u5934\u6570\u636e\uff08\u5217\u8868\u6570\u636e\u4e0a\u65b9\u7684\u975e\u5217\u8868\u6570\u636e\uff09\u652f\u6301\u7eb5\u5411\u5408\u5e76\u5355\u5143\u683c\uff0c\u8868\u5c3e\u6570\u636e\uff08\u5217\u8868\u6570\u636e\u4e0b\u65b9\u7684\u975e\u5217\u8868\u6570\u636e\uff09\u4e0d\u652f\u6301\n * \u5982\u679c\u60f3\u6e32\u67d3\u7a7a\u683c\u7684\u6837\u5f0f\uff0c\u4f8b\u5982\u5408\u5e76\u5355\u5143\u683c\uff0c\u4e5f\u5fc5\u987b\u586b\u5145\"{{}}'\"\n * \u6a21\u7248\u7684\u590d\u5236\uff0c\u5c5e\u4e8e\u9ed1\u7bb1\u64cd\u4f5c\uff0c\u56e0\u6b64\u6837\u5f0f\uff08\u4f8b\u5982\uff1a\u8fb9\u6846\u7b49\uff09\u9700\u8981\u8ba4\u771f\u8bbe\u7f6e\u3002\n\n## \u5f85\u8865\u5145\u7684\u65b9\u9762\n* \u4e0d\u652f\u6301\u8868\u5c3e\u6570\u636e\u5408\u5e76\u5355\u5143\u683c\uff0c\u6709\u9700\u6c42\u53ef\u6539\u8fdb\u3002\n* \u5217\u8868\u6570\u636e\u53ea\u652f\u6301\u4e00\u79cd\u751f\u6210\u89c4\u5219\uff0c\u4e0d\u652f\u6301\u4e0d\u540c\u5217\u533a\u57df\u5185\u5b58\u5728\u4e0d\u540c\u7684\u751f\u6210\u89c4\u5219\u3002\n* \u51fa\u73b0\u8fc7\u751f\u6210Excel\u6587\u4ef6\u65f6\u95f4\u8fc7\u957f\uff0c\u5bfc\u81f4\u63a5\u53e3\u8d85\u65f6\u7684\u60c5\u51b5\uff0c\u76ee\u524d\u8fd8\u672a\u5bf9\u5176\u8fdb\u884c\u7814\u7a76\u8fc7\u3002\n\u5efa\u8bae\u89e3\u51b3\u65b9\u6cd5\u662f\uff0c\u5c06\u5176\u653e\u5230\u5f02\u6b65\u4efb\u52a1\u4e2d\u6267\u884c\u3002\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/qjjayy/excel_template", "keywords": "excel template render", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "excel-template", "package_url": "https://pypi.org/project/excel-template/", "platform": "any", "project_url": "https://pypi.org/project/excel-template/", "project_urls": { "Homepage": "https://github.com/qjjayy/excel_template" }, "release_url": "https://pypi.org/project/excel-template/0.1.5/", "requires_dist": [ "openpyxl" ], "requires_python": "", "summary": "Create Excel file according to the Excel template which fits a specific format", "version": "0.1.5" }, "last_serial": 5719008, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "06a53b451d9336fe31dd06493b7d3220", "sha256": "1de234676d14e89fe9529ed5234fac58c972e6554bcdf8586b7d0724a2bff847" }, "downloads": -1, "filename": "excel_template-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "06a53b451d9336fe31dd06493b7d3220", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5443, "upload_time": "2019-01-31T03:08:38", "url": "https://files.pythonhosted.org/packages/1e/8f/cde67f1e5d5d758b5b815c18c9bc507ef25b871e5b7aff16a9640620a973/excel_template-0.1.1-py2.py3-none-any.whl" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a8229ec6618bbcab703b37b453d17587", "sha256": "2184b690f3336c8b7ee5c6d31c36d8075c6e5a8ea3446410b5a28d21a79c7a31" }, "downloads": -1, "filename": "excel_template-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a8229ec6618bbcab703b37b453d17587", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6921, "upload_time": "2019-01-31T08:33:30", "url": "https://files.pythonhosted.org/packages/a1/9b/56391b717ae08a18440c4bb2fbb2db4dbc8a39852d1eef995fe9b44e6d96/excel_template-0.1.2-py2.py3-none-any.whl" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "9c3e30baec304dad81bcc4f21054aba4", "sha256": "a12f7a6ff561e9b52d63d7800df19d153418b626326d31b1bac7d0938f6d5030" }, "downloads": -1, "filename": "excel_template-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9c3e30baec304dad81bcc4f21054aba4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7073, "upload_time": "2019-01-31T09:49:24", "url": "https://files.pythonhosted.org/packages/71/22/9f1866fab2f272ef5c24d7bd00edd4482ebd89c376d188ab731c197adc57/excel_template-0.1.3-py2.py3-none-any.whl" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "0e87a61f04275caf6a03789d705aab6c", "sha256": "3feb0e4ff65e274dd7814378751e18bdf4d2d625a33ffead45c92f55cd92f699" }, "downloads": -1, "filename": "excel_template-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0e87a61f04275caf6a03789d705aab6c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7175, "upload_time": "2019-08-23T06:08:24", "url": "https://files.pythonhosted.org/packages/48/32/e1884a4f69a8e925c01520beb187c0ee58107189f1556381ca3e54c4313b/excel_template-0.1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "29fe04ff9032393d3fe43e31dc17eb59", "sha256": "eee2102aca5723b37513e9b324346b995416a437fbdc92a9349e187355dc9194" }, "downloads": -1, "filename": "excel-template-0.1.5.tar.gz", "has_sig": false, "md5_digest": "29fe04ff9032393d3fe43e31dc17eb59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6088, "upload_time": "2019-08-23T06:08:26", "url": "https://files.pythonhosted.org/packages/9d/39/577369db8e455e1c33f8661d4893a724f96455ff8c85ab8521420799b028/excel-template-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0e87a61f04275caf6a03789d705aab6c", "sha256": "3feb0e4ff65e274dd7814378751e18bdf4d2d625a33ffead45c92f55cd92f699" }, "downloads": -1, "filename": "excel_template-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0e87a61f04275caf6a03789d705aab6c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7175, "upload_time": "2019-08-23T06:08:24", "url": "https://files.pythonhosted.org/packages/48/32/e1884a4f69a8e925c01520beb187c0ee58107189f1556381ca3e54c4313b/excel_template-0.1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "29fe04ff9032393d3fe43e31dc17eb59", "sha256": "eee2102aca5723b37513e9b324346b995416a437fbdc92a9349e187355dc9194" }, "downloads": -1, "filename": "excel-template-0.1.5.tar.gz", "has_sig": false, "md5_digest": "29fe04ff9032393d3fe43e31dc17eb59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6088, "upload_time": "2019-08-23T06:08:26", "url": "https://files.pythonhosted.org/packages/9d/39/577369db8e455e1c33f8661d4893a724f96455ff8c85ab8521420799b028/excel-template-0.1.5.tar.gz" } ] }