wokelo-docs


Namewokelo-docs JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryCombined package for creating, reading, and updating DOCX and PPTX files
upload_time2025-08-18 21:22:21
maintainerNone
docs_urlNone
authorWokelo
requires_python>=3.8
licenseMIT, Apache-2.0
keywords powerpoint ppt pptx word docx openxml office wokelo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Wokelo Docs

**Create, read, and update Microsoft Word (.docx) and PowerPoint (.pptx) files with extended features**

Wokelo Docs is an open-source Python library that merges and extends the functionality of [**python-docx**](https://github.com/python-openxml/python-docx) and [**python-pptx**](https://github.com/scanny/python-pptx), empowering developers to automate and enhance document and presentation creation. This library is designed to enable seamless generation and manipulation of Microsoft Word and PowerPoint files without requiring Microsoft Office.

## Features

### Word Enhancements
- Native support for **comments** and **footnotes**.
- Enhanced chart support, allowing the addition of dynamic charts to Word documents, positioning and scaling them with precision.

### PowerPoint Enhancements
- New functionality for **adding and manipulating pictures** in slide masters with improved picture shape ID management.

### Office File Analysis
- Extract text and images from both Word and PowerPoint files.


## Installation

Install via pip:

```bash
pip install wokelo-docs
```

## Usage

### Word Documents (.docx)

Create and manipulate Word documents, including comments and footnotes

```python
from wokelo_docs.docx import Document
from datetime import datetime

# Create document with comprehensive comment usage
doc = Document()

# Add content
p1 = doc.add_paragraph("This is the introduction paragraph.")
p2 = doc.add_paragraph("This paragraph contains important information.")

# Add comments to specific runs
intro_run = p1.runs[0]
intro_comment = intro_run.add_comment(
    text="Consider expanding this introduction",
    author="Reviewer 1",
    initials="R1",
    dtime=datetime.now().isoformat()
)

important_run = p2.runs[0]
important_comment = important_run.add_comment(
    text="This needs fact-checking",
    author="Editor",
    initials="ED"
)

# Save and later read comments
doc.save('reviewed_document.docx')

# Read comments back
doc2 = Document('reviewed_document.docx')
for paragraph in doc2.paragraphs:
    for run in paragraph.runs:
        if run.comments:
            for comment in run.comments:
                print(f"{comment.author}: {comment.text}")
```

### PowerPoint Presentations (.pptx)

Create and update PowerPoint presentations, suitable for dynamic content or automation.

```python
from wokelo_docs.pptx import Presentation
from wokelo_docs.pptx.enum.shapes import MSO_SHAPE
from wokelo_docs.pptx.util import Inches

prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[0])

# Create individual shapes first
shape1 = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, Inches(1), Inches(1), Inches(1), Inches(1))
shape2 = slide.shapes.add_shape(MSO_SHAPE.OVAL, Inches(2.5), Inches(1), Inches(1), Inches(1))
shape3 = slide.shapes.add_shape(MSO_SHAPE.TRIANGLE, Inches(1.75), Inches(2.5), Inches(1), Inches(1))

# Create a group with the shapes
group = slide.shapes.add_group_shape([shape1, shape2, shape3])

# The group automatically calculates its extents based on contained shapes
print(f"Group position: ({group.left}, {group.top})")
print(f"Group size: {group.width} x {group.height}")

# Add more shapes to the group
group_shapes = group.shapes
new_shape = group_shapes.add_shape(
    MSO_SHAPE.STAR_5_POINT,
    Inches(0.5),  # Relative to group
    Inches(0.5),
    Inches(0.5),
    Inches(0.5)
)

prs.save('presentation_with_groups.pptx')
```

For documentation, please refer [Docs](./Docs/)

## Acknowledgment
Wokelo Docs leverages the incredible work done by the open-source projects [**python-docx**](https://github.com/python-openxml/python-docx) and [**python-pptx**](https://github.com/scanny/python-pptx) for handling Microsoft Word and PowerPoint file operations. These libraries form the foundation of Wokelo Docs, upon which we've added enhanced features for more dynamic content generation and richer document functionality.


## License

This project is dual-licensed under the MIT License and the Apache 2.0 License  [LICENSE](LICENSE)

The core code of the project is licensed under the MIT License.

New features, enhancements, or contributions are licensed under the Apache 2.0 License.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "wokelo-docs",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Wokelo <support@wokelo.ai>",
    "keywords": "powerpoint, ppt, pptx, word, docx, openxml, office, wokelo",
    "author": "Wokelo",
    "author_email": "support@wokelo.ai",
    "download_url": "https://files.pythonhosted.org/packages/24/ca/2d8c0a71942d99172467e745d84a088a9f9d7b5a9f4702b402f4ddd4b856/wokelo_docs-0.1.0.tar.gz",
    "platform": null,
    "description": "# Wokelo Docs\r\n\r\n**Create, read, and update Microsoft Word (.docx) and PowerPoint (.pptx) files with extended features**\r\n\r\nWokelo Docs is an open-source Python library that merges and extends the functionality of [**python-docx**](https://github.com/python-openxml/python-docx) and [**python-pptx**](https://github.com/scanny/python-pptx), empowering developers to automate and enhance document and presentation creation. This library is designed to enable seamless generation and manipulation of Microsoft Word and PowerPoint files without requiring Microsoft Office.\r\n\r\n## Features\r\n\r\n### Word Enhancements\r\n- Native support for **comments** and **footnotes**.\r\n- Enhanced chart support, allowing the addition of dynamic charts to Word documents, positioning and scaling them with precision.\r\n\r\n### PowerPoint Enhancements\r\n- New functionality for **adding and manipulating pictures** in slide masters with improved picture shape ID management.\r\n\r\n### Office File Analysis\r\n- Extract text and images from both Word and PowerPoint files.\r\n\r\n\r\n## Installation\r\n\r\nInstall via pip:\r\n\r\n```bash\r\npip install wokelo-docs\r\n```\r\n\r\n## Usage\r\n\r\n### Word Documents (.docx)\r\n\r\nCreate and manipulate Word documents, including comments and footnotes\r\n\r\n```python\r\nfrom wokelo_docs.docx import Document\r\nfrom datetime import datetime\r\n\r\n# Create document with comprehensive comment usage\r\ndoc = Document()\r\n\r\n# Add content\r\np1 = doc.add_paragraph(\"This is the introduction paragraph.\")\r\np2 = doc.add_paragraph(\"This paragraph contains important information.\")\r\n\r\n# Add comments to specific runs\r\nintro_run = p1.runs[0]\r\nintro_comment = intro_run.add_comment(\r\n    text=\"Consider expanding this introduction\",\r\n    author=\"Reviewer 1\",\r\n    initials=\"R1\",\r\n    dtime=datetime.now().isoformat()\r\n)\r\n\r\nimportant_run = p2.runs[0]\r\nimportant_comment = important_run.add_comment(\r\n    text=\"This needs fact-checking\",\r\n    author=\"Editor\",\r\n    initials=\"ED\"\r\n)\r\n\r\n# Save and later read comments\r\ndoc.save('reviewed_document.docx')\r\n\r\n# Read comments back\r\ndoc2 = Document('reviewed_document.docx')\r\nfor paragraph in doc2.paragraphs:\r\n    for run in paragraph.runs:\r\n        if run.comments:\r\n            for comment in run.comments:\r\n                print(f\"{comment.author}: {comment.text}\")\r\n```\r\n\r\n### PowerPoint Presentations (.pptx)\r\n\r\nCreate and update PowerPoint presentations, suitable for dynamic content or automation.\r\n\r\n```python\r\nfrom wokelo_docs.pptx import Presentation\r\nfrom wokelo_docs.pptx.enum.shapes import MSO_SHAPE\r\nfrom wokelo_docs.pptx.util import Inches\r\n\r\nprs = Presentation()\r\nslide = prs.slides.add_slide(prs.slide_layouts[0])\r\n\r\n# Create individual shapes first\r\nshape1 = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, Inches(1), Inches(1), Inches(1), Inches(1))\r\nshape2 = slide.shapes.add_shape(MSO_SHAPE.OVAL, Inches(2.5), Inches(1), Inches(1), Inches(1))\r\nshape3 = slide.shapes.add_shape(MSO_SHAPE.TRIANGLE, Inches(1.75), Inches(2.5), Inches(1), Inches(1))\r\n\r\n# Create a group with the shapes\r\ngroup = slide.shapes.add_group_shape([shape1, shape2, shape3])\r\n\r\n# The group automatically calculates its extents based on contained shapes\r\nprint(f\"Group position: ({group.left}, {group.top})\")\r\nprint(f\"Group size: {group.width} x {group.height}\")\r\n\r\n# Add more shapes to the group\r\ngroup_shapes = group.shapes\r\nnew_shape = group_shapes.add_shape(\r\n    MSO_SHAPE.STAR_5_POINT,\r\n    Inches(0.5),  # Relative to group\r\n    Inches(0.5),\r\n    Inches(0.5),\r\n    Inches(0.5)\r\n)\r\n\r\nprs.save('presentation_with_groups.pptx')\r\n```\r\n\r\nFor documentation, please refer [Docs](./Docs/)\r\n\r\n## Acknowledgment\r\nWokelo Docs leverages the incredible work done by the open-source projects [**python-docx**](https://github.com/python-openxml/python-docx) and [**python-pptx**](https://github.com/scanny/python-pptx) for handling Microsoft Word and PowerPoint file operations. These libraries form the foundation of Wokelo Docs, upon which we've added enhanced features for more dynamic content generation and richer document functionality.\r\n\r\n\r\n## License\r\n\r\nThis project is dual-licensed under the MIT License and the Apache 2.0 License  [LICENSE](LICENSE)\r\n\r\nThe core code of the project is licensed under the MIT License.\r\n\r\nNew features, enhancements, or contributions are licensed under the Apache 2.0 License.\r\n",
    "bugtrack_url": null,
    "license": "MIT, Apache-2.0",
    "summary": "Combined package for creating, reading, and updating DOCX and PPTX files",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/Wokelo-AI/wokelo-docs",
        "Repository": "https://github.com/Wokelo-AI/wokelo-docs"
    },
    "split_keywords": [
        "powerpoint",
        " ppt",
        " pptx",
        " word",
        " docx",
        " openxml",
        " office",
        " wokelo"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "df6b9504ac13fb63c4d3ad65c616f986e679d42ddfa93932c5573dacc96e7b40",
                "md5": "86ae0d4e74133ee6f951cbcb79bdb6df",
                "sha256": "2c3d2ded6dd75faee54be0f39fcf928c484cefbca06f45bbb50d1f5a59d06809"
            },
            "downloads": -1,
            "filename": "wokelo_docs-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "86ae0d4e74133ee6f951cbcb79bdb6df",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 794560,
            "upload_time": "2025-08-18T21:22:19",
            "upload_time_iso_8601": "2025-08-18T21:22:19.751164Z",
            "url": "https://files.pythonhosted.org/packages/df/6b/9504ac13fb63c4d3ad65c616f986e679d42ddfa93932c5573dacc96e7b40/wokelo_docs-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "24ca2d8c0a71942d99172467e745d84a088a9f9d7b5a9f4702b402f4ddd4b856",
                "md5": "e2e05e653746b9f2996841362e50ff01",
                "sha256": "96c8ab97a9d54952e257a26c2b2e7431cedc6dd897db7d65f262dda0848096e6"
            },
            "downloads": -1,
            "filename": "wokelo_docs-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e2e05e653746b9f2996841362e50ff01",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 634663,
            "upload_time": "2025-08-18T21:22:21",
            "upload_time_iso_8601": "2025-08-18T21:22:21.351759Z",
            "url": "https://files.pythonhosted.org/packages/24/ca/2d8c0a71942d99172467e745d84a088a9f9d7b5a9f4702b402f4ddd4b856/wokelo_docs-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-18 21:22:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Wokelo-AI",
    "github_project": "wokelo-docs",
    "github_not_found": true,
    "lcname": "wokelo-docs"
}
        
Elapsed time: 1.03976s