cmi-docx


Namecmi-docx JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
Summary.docx utilities
upload_time2024-07-22 14:44:04
maintainerNone
docs_urlNone
authorReinder Vos de Wael
requires_python>=3.10
licenseLGPL-2.1
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": "Reinder Vos de Wael",
    "author_email": "reinder.vosdewael@childmind.org",
    "download_url": "https://files.pythonhosted.org/packages/1b/e5/43ca0fa3922096fa1205eb262778e74abd26167748c00102d74b4dafada5/cmi_docx-0.3.0.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\n",
    "bugtrack_url": null,
    "license": "LGPL-2.1",
    "summary": ".docx utilities",
    "version": "0.3.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c44590fed121e14f6230efdb3e53b59fc0443679e3f91baf2cff2b038cb37445",
                "md5": "63ba1dba144e1a4eb0a0bedf5461f3a2",
                "sha256": "50e44580d74ffe1a7d7190346403ff92ecfda3b5c7461032bd540b273c9feb0a"
            },
            "downloads": -1,
            "filename": "cmi_docx-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "63ba1dba144e1a4eb0a0bedf5461f3a2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 17395,
            "upload_time": "2024-07-22T14:44:03",
            "upload_time_iso_8601": "2024-07-22T14:44:03.575384Z",
            "url": "https://files.pythonhosted.org/packages/c4/45/90fed121e14f6230efdb3e53b59fc0443679e3f91baf2cff2b038cb37445/cmi_docx-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1be543ca0fa3922096fa1205eb262778e74abd26167748c00102d74b4dafada5",
                "md5": "02062f4b3ff52e1382df8aae4f8592f3",
                "sha256": "52cc2acd65e26174ff4d13dd55695a7d004d85bd7e0f3590c748189a7a96317d"
            },
            "downloads": -1,
            "filename": "cmi_docx-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "02062f4b3ff52e1382df8aae4f8592f3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 16179,
            "upload_time": "2024-07-22T14:44:04",
            "upload_time_iso_8601": "2024-07-22T14:44:04.990345Z",
            "url": "https://files.pythonhosted.org/packages/1b/e5/43ca0fa3922096fa1205eb262778e74abd26167748c00102d74b4dafada5/cmi_docx-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-22 14:44:04",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "cmi-docx"
}
        
Elapsed time: 0.39489s