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.3.0.tar.gz (207.4 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.3.0-py3-none-any.whl (259.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skelmis_docx-2.3.0.tar.gz
  • Upload date:
  • Size: 207.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.13

File hashes

Hashes for skelmis_docx-2.3.0.tar.gz
Algorithm Hash digest
SHA256 25fdef85d3e805657f5bc40e89b853e0a6deecc3365d8edd206bdb6ad6e3deb2
MD5 b86c163ea1ac412bfbb3d6cfa3ffc04f
BLAKE2b-256 0047dbbbf54f4f46368984be9e78dc709454416f2ee9522ac5d1a6cc0b917b4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for skelmis_docx-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c918aee5d08c2962833b1ba49c583a1e3aeb20c747185587e8d88aa7dbafddea
MD5 fa7d7604f8d466c9c753fad2ed9a4403
BLAKE2b-256 a77f69ba352c927f2a33f34484a70c3391e87ee3df35d6e9dc55ceb008225e60

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