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.3.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

docx_report-0.1.3-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

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