docdocgo
Insert pandas DataFrames as tables into Microsoft Word documents.
Features
- Simple API: Just call
docdocgo(df, "document.docx")to update Word documents - Marker Replacement: Use markers like
{{QUARTERLY_NUMBERS}}in your Word templates - Professional Styling: Tables with dark blue headers and alternating row colors
- Type Support: Handles all pandas data types including NaN values
- Performance Optimized: Efficient table creation for large DataFrames
Installation
uv add docdocgo
Or with pip:
pip install docdocgo
Quick Start
import pandas as pd
from docx import Document
import docdocgo
data = pd.DataFrame({
"Quarter": ["Q1", "Q2", "Q3", "Q4"],
"Revenue": [120000, 135000, 142000, 158000],
"Profit": [25000, 32000, 28000, 41000],
})
doc = Document()
doc.add_heading("Quarterly Report", 0)
doc.add_paragraph("Here are the quarterly results:")
doc.add_paragraph("{{QUARTERLY_DATA}}")
doc.add_paragraph("Thank you for reviewing this report.")
doc.save("template.docx")
docdocgo.insert_table(data, "template.docx", "{{QUARTERLY_DATA}}", "result.docx")
This transforms your template document into a final report:
📄 template.docx → 📊 result.docx
From template with marker to professional report with formatted table
API Reference
docdocgo(df, path, marker=None, output_path=None)
Convenience function to insert DataFrame into Word document.
Parameters:
df(pandas.DataFrame): DataFrame to insertpath(str | Path): Path to Word documentmarker(str, optional): Marker to replace. If None, creates new documentoutput_path(str | Path, optional): Output path. If None, overwrites input file
create_document_with_table(df, output_path)
Create a new Word document with a DataFrame table.
Parameters:
df(pandas.DataFrame): DataFrame to insertoutput_path(str | Path): Path for the new document
insert_table(df, docx_path, marker, output_path=None)
Replace a marker in an existing Word document with a DataFrame table.
Parameters:
df(pandas.DataFrame): DataFrame to insertdocx_path(str | Path): Path to existing Word documentmarker(str): Marker string to replaceoutput_path(str | Path, optional): Output path. If None, overwrites input document
Development
Uses just.
# Clone and setup
git clone <repository>
cd docdocgo
uv sync
# Run tests and examples
just test
License
MIT License
Metadata
Release files for docdocgo 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| docdocgo-0.1.0.tar.gz | 216.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| docdocgo-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 223.1 kB
Release files / docdocgo-0.1.0.tar.gz
| Download URL | docdocgo-0.1.0.tar.gz |
|---|---|
| Size | 216.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fec77454ce7c8d3df3967b69730d0b29bce96fa6df8ca0d2ef8adfc06ad222a
|
|
BLAKE2b-256 checksum How to use checksums |
7667c9c44e79f0cca3aeac74dc7e8d45c72976781f2da474b8fa242c42289ef6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.5
|
Release files / docdocgo-0.1.0-py3-none-any.whl
| Download URL | docdocgo-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70843a42bf629e897716f51b479a5724edf0396d77a8d72124e6c1bf53fbae50
|
|
BLAKE2b-256 checksum How to use checksums |
406f40fc54d9edef9185aab8054b25b0d4653c09aba2fb592f99c5e27492f579
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.5
|
Security for docdocgo 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.