Skip to main content

Additional tooling for Python-docx.

Project description

CMI-docx

Build codecov Ruff stability-stable LGPL--2.1 License pages

cmi-docx is a Python library for manipulating .docx files built on top of python-docx. It extends the functionality of python-docx by providing additional features and utilities for working with .docx files.

Features

  • Find and replace.
  • Insert paragraphs in the middle of a document.
  • Manipulate styles and formatting of paragraphs' substrings.

Installation

Install this package from pypi using your favorite package manager. For example, using pip:

pip install cmi-docx

Quick start

The following example demonstratesa few features of cmi-docx:

import docx

from cmi_docx import document

doc = docx.Document()
paragraph = doc.add_paragraph("Hello, world!")
extend_document = document.ExtendDocument(doc)
extend_paragraph = document.ExtendParagraph(paragraph)

# Find and replace text.
extend_document.replace("Hello", "Hi", {"bold": True})

# Insert and image
extend_document.insert_image(index=1, image_path="path/to/image.png")

# Reformat a paragraph
extend_paragraph.format(italics=True)

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

cmi_docx-0.5.0.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

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

cmi_docx-0.5.0-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

Details for the file cmi_docx-0.5.0.tar.gz.

File metadata

  • Download URL: cmi_docx-0.5.0.tar.gz
  • Upload date:
  • Size: 41.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cmi_docx-0.5.0.tar.gz
Algorithm Hash digest
SHA256 732edeaa55436418bb50fdd93bd08fea55637df104df7f2129c594eb77640d2b
MD5 557480153810e90265e885d3c81b41bb
BLAKE2b-256 7e3785d367aa635e0652d4245a309f4757b7f24ee38da1871d7e1e3bc92b450f

See more details on using hashes here.

Provenance

The following attestation bundles were made for cmi_docx-0.5.0.tar.gz:

Publisher: pypi.yaml on childmindresearch/cmi-docx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cmi_docx-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: cmi_docx-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 32.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cmi_docx-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d4a5eaaaf35d0af9f90367119e25b0dd9d2a7b4fc081206eac9edc93599b4d0
MD5 5c8b8cebf81b7bd34c8755111596d6c7
BLAKE2b-256 1ef70eae562c7f3cfed98fe83e629a473b83c773aeee73e17c8046af4982bd3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cmi_docx-0.5.0-py3-none-any.whl:

Publisher: pypi.yaml on childmindresearch/cmi-docx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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