Skip to main content

Create, read, and update Microsoft Word .docx files.

Project description

python-docx

python-docx is a Python library for reading, creating, and updating Microsoft Word 2007+ (.docx) files.

This repository exists as a fork of the official repo as I needed features and quality of life improvements.

Key differences at a glance:

  • Supporting multiple numbered lists within a document (1, 2)
  • Supporting TOC updates within the package without the need to open the document manually (1, 2)
  • Supporting floating images within documents (1)
  • Supporting the ability to transform word documents into PDF's (1)
  • Horizontal rules + paragraph bounding boxes / borders (1, 2)
  • External hyperlinks (1)
  • Internal hyperlinks (Linking to bookmarks) (1)
  • Creating bookmarks (1)
  • The ability to insert a customisable Table of Contents (ToC) (1)

Installation

pip install skelmis-docx

Example

>>> from skelmis.docx import Document

>>> document = Document()
>>> document.add_paragraph("It was a dark and stormy night.")
<docx.text.paragraph.Paragraph object at 0x10f19e760>
>>> document.save("dark-and-stormy.docx")

>>> document = Document("dark-and-stormy.docx")
>>> document.paragraphs[0].text
'It was a dark and stormy night.'

More information is available in the documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skelmis_docx-2.6.0.tar.gz (207.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skelmis_docx-2.6.0-py3-none-any.whl (260.3 kB view details)

Uploaded Python 3

File details

Details for the file skelmis_docx-2.6.0.tar.gz.

File metadata

  • Download URL: skelmis_docx-2.6.0.tar.gz
  • Upload date:
  • Size: 207.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for skelmis_docx-2.6.0.tar.gz
Algorithm Hash digest
SHA256 0f160d36b7d66834152219d7584b79bd2c9eddb4b88edc45d0cca9603254b692
MD5 596aaac28a6f32fea3d3258c2e283a6b
BLAKE2b-256 99ec0db2a5187ee191877f1accc2136e5e481308acf0bea6b8446b61f9ab10e0

See more details on using hashes here.

File details

Details for the file skelmis_docx-2.6.0-py3-none-any.whl.

File metadata

  • Download URL: skelmis_docx-2.6.0-py3-none-any.whl
  • Upload date:
  • Size: 260.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for skelmis_docx-2.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ad458607b1cec09c6ef2ef0491ad3a9ef4d073169cfbe977b94ccbe18121a10
MD5 54d35f890c145919e1fb62ebf922ef4e
BLAKE2b-256 6e271ed736d2a08b5e52c4339c965d74c924a4f8f6da9a70b5f5dfeb4fc0f0c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page