Skip to main content

A wrapper for the python-docx library that simplifies creating Word documents in Python

Project description

https://codecov.io/gh/christopher-hacker/docx-report/branch/main/graph/badge.svg?token=019MXVQYN5 tests PyPI version

docx-report

This is a simple wrapper for the python-docx package that makes creating Word documents in Python easier. It contains convenience methods for creating tables and inserting data visualizations directly from Pandas dataframes, as well as simpler syntax for generally writing text to a document.

Installation

pip install docx-report

Usage

from docx_report import DocxReport

# Create a new document
doc = DocxReport(title="My Report")

# Add a heading
doc.add_heading("My Heading")

# Add a paragraph
doc.add_paragraph("This is a paragraph.")

# Add a table
doc.add_table(df)  # assuming you have a pandas dataframe called df

# Add a plot
doc.add_plot(df)  # assuming you have a pandas dataframe called df

# Save the document
doc.save("my_report.docx")

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

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

docx_report-0.1.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

docx_report-0.1.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file docx_report-0.1.2.tar.gz.

File metadata

  • Download URL: docx_report-0.1.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for docx_report-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1a6d1221e420e64d96f545d172c410f7eb4ccd5c87d403feb1b6b804f7751375
MD5 52642875d57f0e78c5770da6e607951d
BLAKE2b-256 a3b7f0f48fd56b504918644dda618497577c9ddab8b9b07ecb4efd3864c0c81f

See more details on using hashes here.

File details

Details for the file docx_report-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: docx_report-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for docx_report-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f97fb3c5a7e0246e6bcd2ee21e20daac0e715c8f843d223f963ff101c8fdd603
MD5 715620cc58e3ba5f021ed0ba437aa581
BLAKE2b-256 e00d11d8a7733e55f3761f9198b13eec61ef88735ed7967c353f27444fcd8689

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page