docx


Namedocx JSON
Version 0.2.4 PyPI version JSON
download
home_pagehttp://github.com/mikemaccana/python-docx
SummaryThe docx module creates, reads and writes Microsoft Office Word 2007 docx files
upload_time2014-02-06 10:02:49
maintainerNone
docs_urlNone
authorSteve Canny
requires_pythonNone
licenseUNKNOWN
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ###########
Python docx
###########

Introduction
============

The docx module creates, reads and writes Microsoft Office Word 2007 docx
files.

These are referred to as 'WordML', 'Office Open XML' and 'Open XML' by
Microsoft.

These documents can be opened in Microsoft Office 2007 / 2010, Microsoft Mac
Office 2008, Google Docs, OpenOffice.org 3, and Apple iWork 08.

They also `validate as well formed XML <http://validator.w3.org/check>`_.

The module was created when I was looking for a Python support for MS Word
.docx files, but could only find various hacks involving COM automation,
calling .Net or Java, or automating OpenOffice or MS Office.

The docx module has the following features:

Making documents
----------------

Features for making documents include:

- Paragraphs
- Bullets
- Numbered lists
- Document properties (author, company, etc)
- Multiple levels of headings
- Tables
- Section and page breaks
- Images

.. image:: http://github.com/mikemaccana/python-docx/raw/master/screenshot.png


Editing documents
-----------------

Thanks to the awesomeness of the lxml module, we can:

- Search and replace
- Extract plain text of document
- Add and delete items anywhere within the document
- Change document properties
- Run xpath queries against particular locations in the document - useful for
  retrieving data from user-completed templates.


Getting started
===============

Making and Modifying Documents
------------------------------

- Just `download python docx <http://github.com/mikemaccana/python-docx/tarball/master>`_.
- Use **pip** or **easy_install** to fetch the **lxml** and **PIL** modules.
- Then run::

    example-makedocument.py


Congratulations, you just made and then modified a Word document!


Extracting Text from a Document
-------------------------------

If you just want to extract the text from a Word file, run::

    example-extracttext.py 'Some word file.docx' 'new file.txt'


Ideas & To Do List
~~~~~~~~~~~~~~~~~~

- Further improvements to image handling
- Document health checks
- Egg
- Markdown conversion support


We love forks, changes and pull requests!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Check out the [HACKING](HACKING.markdown) to add your own changes!
- For this project on github
- Send a pull request via github and we'll add your changes!

Want to talk? Need help?
~~~~~~~~~~~~~~~~~~~~~~~~

Email python-docx@googlegroups.com


License
~~~~~~~

Licensed under the `MIT license <http://www.opensource.org/licenses/mit-license.php>`_

Short version: this code is copyrighted to me (Mike MacCana), I give you
permission to do what you want with it except remove my name from the credits.
See the LICENSE file for specific terms.

            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/mikemaccana/python-docx",
    "name": "docx",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Steve Canny",
    "author_email": "python-docx@googlegroups.com",
    "download_url": "https://files.pythonhosted.org/packages/4a/8e/5a01644697b03016de339ef444cfff28367f92984dc74eddaab1ed60eada/docx-0.2.4.tar.gz",
    "platform": "UNKNOWN",
    "description": "###########\nPython docx\n###########\n\nIntroduction\n============\n\nThe docx module creates, reads and writes Microsoft Office Word 2007 docx\nfiles.\n\nThese are referred to as 'WordML', 'Office Open XML' and 'Open XML' by\nMicrosoft.\n\nThese documents can be opened in Microsoft Office 2007 / 2010, Microsoft Mac\nOffice 2008, Google Docs, OpenOffice.org 3, and Apple iWork 08.\n\nThey also `validate as well formed XML <http://validator.w3.org/check>`_.\n\nThe module was created when I was looking for a Python support for MS Word\n.docx files, but could only find various hacks involving COM automation,\ncalling .Net or Java, or automating OpenOffice or MS Office.\n\nThe docx module has the following features:\n\nMaking documents\n----------------\n\nFeatures for making documents include:\n\n- Paragraphs\n- Bullets\n- Numbered lists\n- Document properties (author, company, etc)\n- Multiple levels of headings\n- Tables\n- Section and page breaks\n- Images\n\n.. image:: http://github.com/mikemaccana/python-docx/raw/master/screenshot.png\n\n\nEditing documents\n-----------------\n\nThanks to the awesomeness of the lxml module, we can:\n\n- Search and replace\n- Extract plain text of document\n- Add and delete items anywhere within the document\n- Change document properties\n- Run xpath queries against particular locations in the document - useful for\n  retrieving data from user-completed templates.\n\n\nGetting started\n===============\n\nMaking and Modifying Documents\n------------------------------\n\n- Just `download python docx <http://github.com/mikemaccana/python-docx/tarball/master>`_.\n- Use **pip** or **easy_install** to fetch the **lxml** and **PIL** modules.\n- Then run::\n\n    example-makedocument.py\n\n\nCongratulations, you just made and then modified a Word document!\n\n\nExtracting Text from a Document\n-------------------------------\n\nIf you just want to extract the text from a Word file, run::\n\n    example-extracttext.py 'Some word file.docx' 'new file.txt'\n\n\nIdeas & To Do List\n~~~~~~~~~~~~~~~~~~\n\n- Further improvements to image handling\n- Document health checks\n- Egg\n- Markdown conversion support\n\n\nWe love forks, changes and pull requests!\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Check out the [HACKING](HACKING.markdown) to add your own changes!\n- For this project on github\n- Send a pull request via github and we'll add your changes!\n\nWant to talk? Need help?\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nEmail python-docx@googlegroups.com\n\n\nLicense\n~~~~~~~\n\nLicensed under the `MIT license <http://www.opensource.org/licenses/mit-license.php>`_\n\nShort version: this code is copyrighted to me (Mike MacCana), I give you\npermission to do what you want with it except remove my name from the credits.\nSee the LICENSE file for specific terms.\n",
    "bugtrack_url": null,
    "license": "UNKNOWN",
    "summary": "The docx module creates, reads and writes Microsoft Office Word 2007 docx files",
    "version": "0.2.4",
    "project_urls": {
        "Download": "UNKNOWN",
        "Homepage": "http://github.com/mikemaccana/python-docx"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4a8e5a01644697b03016de339ef444cfff28367f92984dc74eddaab1ed60eada",
                "md5": "9ef0cd4157edcf37ee789bc0f98a9114",
                "sha256": "9d7595eac6e86cda0b7136a2995318d039c1f3eaa368a3300805abbbe5dc8877"
            },
            "downloads": -1,
            "filename": "docx-0.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "9ef0cd4157edcf37ee789bc0f98a9114",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 54925,
            "upload_time": "2014-02-06T10:02:49",
            "upload_time_iso_8601": "2014-02-06T10:02:49.394083Z",
            "url": "https://files.pythonhosted.org/packages/4a/8e/5a01644697b03016de339ef444cfff28367f92984dc74eddaab1ed60eada/docx-0.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2014-02-06 10:02:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mikemaccana",
    "github_project": "python-docx",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "docx"
}
        
Elapsed time: 2.57257s