Skip to main content

Excel file generation tool with pivot tables and charts

Project description

Dumont

Excel file generation tool with data sheets and pivot tables.

Installation

pip install dumont

# Or install with xlwings support
pip install dumont[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

Web UI

Dumont includes a browser-based mini Excel interface powered by sheet.js.

Start the web server

dumont serve

Then open http://127.0.0.1:8000 in your browser.

Server options

# Custom host and port
dumont serve --host 0.0.0.0 --port 3000

# Enable auto-reload for development
dumont serve --reload

Web UI Features

  • Spreadsheet Interface: Excel-like grid with cell editing and keyboard navigation (Tab, Enter, Arrow keys)
  • Data Loading: Load sample data or upload CSV/Excel files
  • Cell Editing: Click any cell to edit, use the formula bar for longer content
  • Row/Column Management: Add or delete rows and columns
  • Pivot Tables: Create pivot tables with configurable:
    • Values (column to aggregate)
    • Index (row grouping)
    • Columns (column grouping)
    • Aggregation function (sum, mean, count, min, max)
  • Export Options:
    • Download Excel using sheet.js (client-side)
    • Download Excel with pivot table using dumont backend

API Endpoints

The FastAPI server exposes the following endpoints:

Endpoint Method Description
/ GET Serve the web UI
/api/health GET Health check
/api/sample GET Get sample data as JSON
/api/upload POST Upload CSV/Excel file
/api/data POST Update data from frontend
/api/columns GET Get column info for pivot config
/api/pivot/preview POST Generate pivot table preview
/api/generate POST Generate Excel with pivot (dumont backend)

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:

  1. Data Sheet: Raw data with auto-fitted columns
  2. 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


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.3.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dumont-0.3.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file dumont-0.3.0.tar.gz.

File metadata

  • Download URL: dumont-0.3.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for dumont-0.3.0.tar.gz
Algorithm Hash digest
SHA256 19dfd98c162425fa689bcbcacb8ef0b1c495d2154ddb43d8d511c4fd5edc0e67
MD5 f38503c2473db0f2f85a1b1641f05b94
BLAKE2b-256 ba056a88247c10540f9aab233311a30e84666609223ff2a8c11e05c52d0e26b3

See more details on using hashes here.

File details

Details for the file dumont-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: dumont-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for dumont-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd60b57b0a670ae5cda9166308aa7614353b0434f263d6e6feadbe04b8e64d8a
MD5 6b9cb8d18cae2f06ba0e6afbbb878167
BLAKE2b-256 c9a97c25264cff36b6f12a93bdfa6aeda00c688eb5b588e3ece1e17f4787793c

See more details on using hashes here.

Supported by

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