cmi-docx


Namecmi-docx JSON
Version 0.3.7 PyPI version JSON
download
home_pageNone
SummaryAdditional tooling for Python-docx.
upload_time2024-12-19 16:25:22
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CMI-docx

[![Build](https://github.com/childmindresearch/cmi-docx/actions/workflows/test.yaml/badge.svg?branch=main)](https://github.com/childmindresearch/cmi-docx/actions/workflows/test.yaml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/childmindresearch/cmi-docx/branch/main/graph/badge.svg?token=22HWWFWPW5)](https://codecov.io/gh/childmindresearch/cmi-docx)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
![stability-stable](https://img.shields.io/badge/stability-stable-green.svg)
[![LGPL--2.1 License](https://img.shields.io/badge/license-LGPL--2.1-blue.svg)](https://github.com/childmindresearch/cmi-docx/blob/main/LICENSE)
[![pages](https://img.shields.io/badge/api-docs-blue)](https://childmindresearch.github.io/cmi-docx)

`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`:

```sh
pip install cmi-docx
```

## Quick start

The following example demonstratesa few features of cmi-docx:

```Python
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)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cmi-docx",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/b2/5a/04513bbfec945215c02e56fa496583b1b4b78b34989c999b4b50c489ffbe/cmi_docx-0.3.7.tar.gz",
    "platform": null,
    "description": "# CMI-docx\n\n[![Build](https://github.com/childmindresearch/cmi-docx/actions/workflows/test.yaml/badge.svg?branch=main)](https://github.com/childmindresearch/cmi-docx/actions/workflows/test.yaml?query=branch%3Amain)\n[![codecov](https://codecov.io/gh/childmindresearch/cmi-docx/branch/main/graph/badge.svg?token=22HWWFWPW5)](https://codecov.io/gh/childmindresearch/cmi-docx)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n![stability-stable](https://img.shields.io/badge/stability-stable-green.svg)\n[![LGPL--2.1 License](https://img.shields.io/badge/license-LGPL--2.1-blue.svg)](https://github.com/childmindresearch/cmi-docx/blob/main/LICENSE)\n[![pages](https://img.shields.io/badge/api-docs-blue)](https://childmindresearch.github.io/cmi-docx)\n\n`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.\n\n## Features\n\n- Find and replace.\n- Insert paragraphs in the middle of a document.\n- Manipulate styles and formatting of paragraphs' substrings.\n\n## Installation\n\nInstall this package from pypi using your favorite package manager. For example, using `pip`:\n\n```sh\npip install cmi-docx\n```\n\n## Quick start\n\nThe following example demonstratesa few features of cmi-docx:\n\n```Python\nimport docx\n\nfrom cmi_docx import document\n\ndoc = docx.Document()\nparagraph = doc.add_paragraph(\"Hello, world!\")\nextend_document = document.ExtendDocument(doc)\nextend_paragraph = document.ExtendParagraph(paragraph)\n\n# Find and replace text.\nextend_document.replace(\"Hello\", \"Hi\", {\"bold\": True})\n\n# Insert and image\nextend_document.insert_image(index=1, image_path=\"path/to/image.png\")\n\n# Reformat a paragraph\nextend_paragraph.format(italics=True)\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Additional tooling for Python-docx.",
    "version": "0.3.7",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0566cc7b383a490b1d8d69a70d8a76cae449d8ca1c5f84c1b5ff81270e8681dd",
                "md5": "4de3743920936a29d3f61a555cd95f3f",
                "sha256": "6524aff36fdd1cecdec4591294091fb2c5c6e409069a847fa5389f345f42387e"
            },
            "downloads": -1,
            "filename": "cmi_docx-0.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4de3743920936a29d3f61a555cd95f3f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 19330,
            "upload_time": "2024-12-19T16:25:20",
            "upload_time_iso_8601": "2024-12-19T16:25:20.689280Z",
            "url": "https://files.pythonhosted.org/packages/05/66/cc7b383a490b1d8d69a70d8a76cae449d8ca1c5f84c1b5ff81270e8681dd/cmi_docx-0.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b25a04513bbfec945215c02e56fa496583b1b4b78b34989c999b4b50c489ffbe",
                "md5": "84a6b53bb72d6a032f7da144ef0a6085",
                "sha256": "025eda8903810adb5f9fb8c8215eff895e664fb0b7073ab5d9349e72d3c33631"
            },
            "downloads": -1,
            "filename": "cmi_docx-0.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "84a6b53bb72d6a032f7da144ef0a6085",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 28122,
            "upload_time": "2024-12-19T16:25:22",
            "upload_time_iso_8601": "2024-12-19T16:25:22.119589Z",
            "url": "https://files.pythonhosted.org/packages/b2/5a/04513bbfec945215c02e56fa496583b1b4b78b34989c999b4b50c489ffbe/cmi_docx-0.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-19 16:25:22",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "cmi-docx"
}
        
Elapsed time: 0.44003s