Excel file generation tool with pivot tables
Project description
Dumont
Excel file generation tool with data sheets and pivot tables.
Installation
# Install with pip
pip install -e .
# Or install with xlwings support
pip install -e ".[xlwings]"
CLI Usage
Generate Excel with sample data
dumont generate -o sales_report.xlsx
Generate from CSV/Excel input
dumont generate -i data.csv -o report.xlsx
Customize pivot table
dumont generate -o report.xlsx \
--pivot-values Revenue \
--pivot-index Category \
--pivot-columns Region \
--aggfunc sum
Use xlwings engine (requires Excel installed)
dumont generate -o report.xlsx --engine xlwings
Preview sample data
dumont sample --rows 20
Preview Excel file contents
dumont preview report.xlsx --sheet Data --rows 10
Get file information
dumont info report.xlsx
Python API Usage
from dumont import create_excel_with_pivot, generate_sample_data
import pandas as pd
# Generate with sample data
create_excel_with_pivot(
output_path="report.xlsx",
use_sample_data=True,
sample_rows=200,
)
# Use your own DataFrame
df = pd.read_csv("my_data.csv")
create_excel_with_pivot(
output_path="report.xlsx",
df=df,
pivot_values="Sales",
pivot_index="Product",
pivot_columns="Quarter",
pivot_aggfunc="sum",
)
# Use xlwings for native Excel features
from dumont import create_excel_with_xlwings
create_excel_with_xlwings(
output_path="report.xlsx",
use_sample_data=True,
visible=True, # Show Excel during creation
)
Output Structure
The generated Excel file contains:
- Data Sheet: Raw data with auto-fitted columns
- Pivot Sheet: Pivot table summarizing the data with margins/totals
Requirements
- Python 3.8+
- pandas
- xlsxwriter
- click
- openpyxl
- xlwings (optional, for advanced Excel features)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dumont-0.1.0.tar.gz
(6.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dumont-0.1.0.tar.gz.
File metadata
- Download URL: dumont-0.1.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e11160eb384ce3cbcf3008abd074d33eb87ba3b93475623bb2fa79f259fdad56
|
|
| MD5 |
42f93e033e2954c61bab12c5a42da932
|
|
| BLAKE2b-256 |
ec8f9d8e00f9cd54640aff41212929f3bad8f5acd188e8af58faff2850d11845
|
File details
Details for the file dumont-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dumont-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71eb99fe5c90dc3227b6cff0f387e2b7879020a0a5821e59bd7c5064faa9e16b
|
|
| MD5 |
fb90ad0f378e2fe54f5318d06df68c84
|
|
| BLAKE2b-256 |
731baf190a17b4a4fd41978ed1a26d15139b2b858542bacb014ac343707426c2
|