{ "info": { "author": "Bouke Haarsma", "author_email": "bouke@webatoom.nl", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Text Processing" ], "description": "===============\ndocx Mail Merge\n===============\n\n.. image:: https://travis-ci.org/Bouke/docx-mailmerge.png?branch=master\n :alt: Build Status\n :target: https://travis-ci.org/Bouke/docx-mailmerge\n\n.. image:: https://badge.fury.io/py/docx-mailmerge.png\n :alt: PyPI\n :target: https://pypi.python.org/pypi/docx-mailmerge\n\nPerforms a Mail Merge on Office Open XML (docx) files. Can be used on any\nsystem without having to install Microsoft Office Word. Supports Python 2.7,\n3.3 and up.\n\nInstallation\n============\n\nInstallation with ``pip``:\n::\n\n $ pip install docx-mailmerge\n\n\nUsage\n=====\n\nOpen the file.\n::\n\n from mailmerge import MailMerge\n with MailMerge('input.docx') as document:\n ...\n\n\nList all merge fields.\n::\n\n print document.get_merge_fields()\n\n\nMerge fields, supplied as kwargs.\n::\n\n document.merge(field1='docx Mail Merge',\n field2='Can be used for merging docx documents')\n\nMerge table rows. In your template, add a MergeField to the row you would like\nto designate as template. Supply the name of this MergeField as ``anchor``\nparameter. The second parameter contains the rows with key-value pairs for\nthe MergeField replacements.\n::\n\n document.merge_rows('col1',\n [{'col1': 'Row 1, Column 1', 'col2': 'Row 1 Column 1'},\n {'col1': 'Row 2, Column 1', 'col2': 'Row 2 Column 1'},\n {'col1': 'Row 3, Column 1', 'col2': 'Row 3 Column 1'}])\n\n\nStarting in version 0.2.0 you can also combine these two separate calls into a\nsingle call to `merge`.\n::\n\n document.merge(field1='docx Mail Merge',\n col1=[\n {'col1': 'A'},\n {'col1': 'B'},\n ])\n\n\nStarting in version 0.2.0 there's also the feature for template merging.\nThis creates a copy of the template for each item in the list, does a merge,\nand separates them by page or section breaks (see function documentation).\n\nWhen using this feature, make sure you don't use comments, footnotes, \nbookmarks, etc. This is because these elements have an id attribute, which\nmust be unique. This library does not handle this, resulting in invalid\ndocuments.\n::\n\n document.merge_templates([\n {'field1': \"Foo\", 'field2: \"Copy #1\"},\n {'field1': \"Bar\", 'field2: \"Copy #2\"},\n ], separator='page_break')\n\n\nWrite document to file. This should be a new file, as ``ZipFile`` cannot modify\nexisting zip files.\n::\n\n document.write('output.docx')\n\nSee also the unit tests and this nice write-up `Populating MS Word Templates\nwith Python`_ on Practical Business Python for more information and examples.\n\nTodo / Wish List\n================\n\n* Image merging.\n\n\nContributing\n============\n\n* Fork the repository on GitHub and start hacking\n* Create / fix the unit tests\n* Send a pull request with your changes\n\nUnit tests\n----------\n\nIn order to make sure that the library performs the way it was designed, unit\ntests are used. When providing new features, or fixing bugs, there should be a\nunit test that demonstrates it. Run the test suite::\n\n python -m unittest discover\n\nCredits\n=======\n\nThis library was written by `Bouke Haarsma`_ and contributors.\n\n.. _Bouke Haarsma: https://twitter.com/BoukeHaarsma\n.. _Populating MS Word Templates with Python: http://pbpython.com/python-word-template.html\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/Bouke/docx-mailmerge", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "docx-mailmerge", "package_url": "https://pypi.org/project/docx-mailmerge/", "platform": "", "project_url": "https://pypi.org/project/docx-mailmerge/", "project_urls": { "Homepage": "http://github.com/Bouke/docx-mailmerge" }, "release_url": "https://pypi.org/project/docx-mailmerge/0.5.0/", "requires_dist": null, "requires_python": "", "summary": "Performs a Mail Merge on docx (Microsoft Office Word) files", "version": "0.5.0" }, "last_serial": 5951443, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "29c92843f63529ee9ce1310043403ffc", "sha256": "e306103e70c0e889948ae9b86a6cc373be8c1304a59df5e1d26b1712dde659af" }, "downloads": -1, "filename": "docx-mailmerge-0.0.1.tar.gz", "has_sig": false, "md5_digest": "29c92843f63529ee9ce1310043403ffc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3614, "upload_time": "2012-12-18T07:43:16", "url": "https://files.pythonhosted.org/packages/50/be/ad0f0c09482508959ba1389b91efa78c701c0b1105bda4f47ba0cab74f09/docx-mailmerge-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "f5c8b63e54caacee00d071e3094b3aac", "sha256": "92010610c37307a9df3a7d0905660259de1342f34a635d42e9e32903d08abf00" }, "downloads": -1, "filename": "docx-mailmerge-0.0.2.tar.gz", "has_sig": false, "md5_digest": "f5c8b63e54caacee00d071e3094b3aac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3933, "upload_time": "2012-12-18T10:57:21", "url": "https://files.pythonhosted.org/packages/f5/d7/e6fefbfd3766da07336b5d3c395e69bdf4a4feefa7ac6c24ed68fe7ca8da/docx-mailmerge-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "72eb5170fd9114bdd67baf92afb92e3c", "sha256": "a1d33f645d8667136cde5d523ab3b3a353b1909d560528d33c5c09754a2808d3" }, "downloads": -1, "filename": "docx-mailmerge-0.1.0.tar.gz", "has_sig": false, "md5_digest": "72eb5170fd9114bdd67baf92afb92e3c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4051, "upload_time": "2013-05-22T18:37:10", "url": "https://files.pythonhosted.org/packages/c9/b4/8b3e1ff7f13028eda5c7971ef0c0993a8240d248d296f13398d58e529a2f/docx-mailmerge-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8d304aab02e6dbdde8e43d6d5190375d", "sha256": "9185beda443bd208abb63bad5ae9d0ca4da4d74df9f585f8c5006c3fa9e4fc74" }, "downloads": -1, "filename": "docx-mailmerge-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8d304aab02e6dbdde8e43d6d5190375d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4195, "upload_time": "2013-05-22T19:11:17", "url": "https://files.pythonhosted.org/packages/2b/d2/0df1d36f8a7294e8e2cb1907545b6bb83dda09498fcf8b9629a9284e88b0/docx-mailmerge-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "fd9a7e1b7dec309c0f2279b3e04c6943", "sha256": "2a78bc102ce81de57e4dfa09cf39e41d36062aaaa40b9da0925f22fe12ab42a3" }, "downloads": -1, "filename": "docx_mailmerge-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fd9a7e1b7dec309c0f2279b3e04c6943", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 5660, "upload_time": "2014-09-20T06:45:06", "url": "https://files.pythonhosted.org/packages/0c/e0/35b45ed0086bee5be023807040b837e5775ab7e7746e6bf7a3fd0b67b0f7/docx_mailmerge-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "89bdcb03913ccb7e38b077944ef8918d", "sha256": "6b450879f32e78def5af9020870ea189fc26f226f983611b439b31887c7ede9e" }, "downloads": -1, "filename": "docx-mailmerge-0.1.2.tar.gz", "has_sig": false, "md5_digest": "89bdcb03913ccb7e38b077944ef8918d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4455, "upload_time": "2014-09-20T06:41:28", "url": "https://files.pythonhosted.org/packages/4b/f1/9b205d810b3c35cc00f8dd563640826c7c1e83664fd9cfd3983eb243512b/docx-mailmerge-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f9597185d5a7e08391829b2203527e1a", "sha256": "bcd8ffec04a28e8c35020ff3de2f31dd59c38537a17f0bc4e628120cad1fa210" }, "downloads": -1, "filename": "docx_mailmerge-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f9597185d5a7e08391829b2203527e1a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6433, "upload_time": "2014-09-20T07:28:55", "url": "https://files.pythonhosted.org/packages/5d/38/665e7ef0b258e918a5952ba1cdc26ded029506e85a26bde0f9286fda71a1/docx_mailmerge-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f995c0b3b5194b20b1ea7a8f0970c7b0", "sha256": "9170616355820db9885340633674b23f2b9e352425f8331885461f073552eb03" }, "downloads": -1, "filename": "docx-mailmerge-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f995c0b3b5194b20b1ea7a8f0970c7b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5081, "upload_time": "2014-09-20T07:28:48", "url": "https://files.pythonhosted.org/packages/6e/1b/bd6fee14ba8d2beb8db666ab4dd9d72b58dd97b4ce10d8fad70fe7a0f58e/docx-mailmerge-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "a1a089ded34ab04c6cf3c89a07193ba4", "sha256": "35a2596ca120f8d762428ef36a8623f3c7375cc26e2bb87f6fe37e61f8327f06" }, "downloads": -1, "filename": "docx_mailmerge-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a1a089ded34ab04c6cf3c89a07193ba4", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 6751, "upload_time": "2016-09-29T19:06:09", "url": "https://files.pythonhosted.org/packages/bd/ed/db6f4752e83af7e1a98dc7311243b84096aa9279d9c69e9ea8d424046657/docx_mailmerge-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "98505bf23371dee97c4b57a095f91b89", "sha256": "3822da7390516b897109dc007e52ef863983d3539dd45730b1fc27ca42e273a5" }, "downloads": -1, "filename": "docx-mailmerge-0.3.0.tar.gz", "has_sig": false, "md5_digest": "98505bf23371dee97c4b57a095f91b89", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5259, "upload_time": "2016-09-29T19:06:06", "url": "https://files.pythonhosted.org/packages/0f/e9/f5f55bb52310ae3b3ac75e428ae65c1e04b732c0d7cc3da915e449232f4c/docx-mailmerge-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "4e23a2c79c38ffac20b8d86b45a2e369", "sha256": "4ff6fad205059626306e31482dec5af62a8c7f73b3529fe7dda4b00a3934bbc5" }, "downloads": -1, "filename": "docx_mailmerge-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4e23a2c79c38ffac20b8d86b45a2e369", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 9331, "upload_time": "2017-11-03T20:18:34", "url": "https://files.pythonhosted.org/packages/7a/89/93f59a8ac238d419dbd10cce3ded62348aaca27c3423db13f22940661451/docx_mailmerge-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bea256387a84f4879a9f1fa66a5db02f", "sha256": "ef2e34f011fe9fd0a53aa60e3b0c3d133ed0d8f4bd5f25a4e985a33eb1dab193" }, "downloads": -1, "filename": "docx-mailmerge-0.4.0.tar.gz", "has_sig": false, "md5_digest": "bea256387a84f4879a9f1fa66a5db02f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6396, "upload_time": "2017-11-03T20:18:32", "url": "https://files.pythonhosted.org/packages/35/b5/3dc86ec849b591f4b6437b2cc7e2847e1481c32e2014d5c1e388bdeb751e/docx-mailmerge-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "a3e41018ccb23eb806134334230aa0d1", "sha256": "0c9d8a0e9230ec337d7e43014280fe6c0b7773adadbfe5f1d9f764d37f072137" }, "downloads": -1, "filename": "docx_mailmerge-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a3e41018ccb23eb806134334230aa0d1", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 9163, "upload_time": "2019-10-09T18:54:13", "url": "https://files.pythonhosted.org/packages/8f/e7/5dd76f3e1023535e114f45cfab39af7ab716c6f0b29600ee52dff9cc4161/docx_mailmerge-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a2c674c92efc7e08a6c3927f8048e55e", "sha256": "6fbe353bd2f87dc6621d9add7bd04896181a469cc543502f1acc0c2444fd632a" }, "downloads": -1, "filename": "docx-mailmerge-0.5.0.tar.gz", "has_sig": false, "md5_digest": "a2c674c92efc7e08a6c3927f8048e55e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7538, "upload_time": "2019-10-09T18:54:11", "url": "https://files.pythonhosted.org/packages/c1/1a/c9290ea9c565cdcf504a2b2e400dfaebe27a64141f87101a6508becef52e/docx-mailmerge-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a3e41018ccb23eb806134334230aa0d1", "sha256": "0c9d8a0e9230ec337d7e43014280fe6c0b7773adadbfe5f1d9f764d37f072137" }, "downloads": -1, "filename": "docx_mailmerge-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a3e41018ccb23eb806134334230aa0d1", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 9163, "upload_time": "2019-10-09T18:54:13", "url": "https://files.pythonhosted.org/packages/8f/e7/5dd76f3e1023535e114f45cfab39af7ab716c6f0b29600ee52dff9cc4161/docx_mailmerge-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a2c674c92efc7e08a6c3927f8048e55e", "sha256": "6fbe353bd2f87dc6621d9add7bd04896181a469cc543502f1acc0c2444fd632a" }, "downloads": -1, "filename": "docx-mailmerge-0.5.0.tar.gz", "has_sig": false, "md5_digest": "a2c674c92efc7e08a6c3927f8048e55e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7538, "upload_time": "2019-10-09T18:54:11", "url": "https://files.pythonhosted.org/packages/c1/1a/c9290ea9c565cdcf504a2b2e400dfaebe27a64141f87101a6508becef52e/docx-mailmerge-0.5.0.tar.gz" } ] }