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.1.tar.gz (42.8 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.1-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cmi_docx-0.5.1.tar.gz
  • Upload date:
  • Size: 42.8 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.1.tar.gz
Algorithm Hash digest
SHA256 9903b53b1e916d0508f15d1bfc4db03bd90d348876d153202aa9e8f1d65e2632
MD5 ae61af9cdb939ad573a4ad36877e56aa
BLAKE2b-256 e084fdbcde5f0d4305fe4c78af4aa1b8ffb16f04b294a2f0886f54cb3577f18e

See more details on using hashes here.

Provenance

The following attestation bundles were made for cmi_docx-0.5.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: cmi_docx-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 33.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da9b4cfb78a6f7a6fea92d05a1a3aadc5e0fce870952d3e51bfad498bf6e518a
MD5 c571b07885562922737616b66646451d
BLAKE2b-256 8ddedb4f60c3065b0d608883510ee13fd7444c5652612532d0548310a9f0c564

See more details on using hashes here.

Provenance

The following attestation bundles were made for cmi_docx-0.5.1-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