Skip to main content

Universal spreadsheet definition language. Define once in Python or YAML, export to ODS/XLSX/PDF. Domain plugins for science, engineering, finance. Native MCP server for AI integration.

Project description

SpreadsheetDL

MCP Version Status Python License Tests Coverage Property Tests Validated

The Universal Spreadsheet Definition Language

Define spreadsheets declaratively in Python or YAML, export to ODS/XLSX/PDF. Built for AI integration with native MCP server. 11 domain plugins with 317+ specialized formulas.


Overview

SpreadsheetDL is a declarative spreadsheet definition language that lets you define structure, formulas, and styling once—then export to any format.

Key Features:

  • 🤖 MCP-Native - Built-in Model Context Protocol server for AI assistants
  • 📝 Declarative API - Define what you want, not how to build it (10 lines vs 100)
  • 🌍 Multi-Format - Single definition → ODS, XLSX, PDF
  • 🔧 Domain Plugins - 11 specialized domains (physics, engineering, finance, data science, etc.)
  • Type-Safe Formulas - FormulaBuilder with circular reference detection
  • 🎨 Theme System - Professional styling without cell-by-cell code
  • 🔒 Security Hardening - XXE protection, ZIP bomb detection, path traversal prevention

vs openpyxl/xlsxwriter:

  • MCP-native (AI integration from day one)
  • Declarative (not imperative cell-by-cell)
  • Multi-format (not Excel-only)
  • Domain-aware (317+ specialized formulas)

Quick Start

Installation

PyPI Package (Ready - Publishing in Progress):

Package is built and ready for publication. Once credentials are configured, install with:

uv pip install spreadsheet-dl                    # Basic installation
uv pip install spreadsheet-dl[security]          # With security enhancements (recommended)
uv pip install spreadsheet-dl[all]               # All features and domains

Install from Source (Current):

git clone https://github.com/lair-click-bats/spreadsheet-dl.git
cd spreadsheet-dl
uv sync

See Installation Guide for detailed options.

Quick Example

from spreadsheet_dl import create_spreadsheet, formula

# Define spreadsheet declaratively
builder = create_spreadsheet(theme="corporate")
builder.sheet("Q1 Budget") \
    .column("Category", width="5cm") \
    .column("Amount", width="4cm", type="currency") \
    .column("% of Total", width="4cm", type="percent") \
    .header_row() \
    .row().cell("Rent").cell(1500).cell(formula=formula().divide("B2", "B5")) \
    .row().cell("Utilities").cell(300).cell(formula=formula().divide("B3", "B5")) \
    .row().cell("Total").cell(formula=formula().sum("B2:B3"))

# Export to any format
builder.save("budget.ods")        # Native ODS
builder.export("budget.xlsx")     # Excel
builder.export("budget.pdf")      # PDF

Result: Professional spreadsheet with formulas, styling, and formatting—in 10 lines instead of 100.

Next Steps

For Users:

For Developers:


Why SpreadsheetDL?

Declarative Paradigm

SpreadsheetDL brings declarative design to spreadsheets—the same paradigm shift that transformed other domains:

Domain Imperative Declarative
Data Cursors, loops SQL
Infrastructure Manual provisioning Terraform
UI DOM manipulation React
Spreadsheets openpyxl SpreadsheetDL

Code Comparison:

# openpyxl (imperative - 15+ lines)
ws['A1'] = 'Category'
ws['A1'].font = Font(bold=True, size=14, color='FFFFFF')
ws['A1'].fill = PatternFill(start_color='366092', fill_type='solid')
ws['A1'].alignment = Alignment(horizontal='center')
ws.column_dimensions['A'].width = 20
# ... repeat for every cell ...

# SpreadsheetDL (declarative - 3 lines)
builder.sheet("Budget") \
    .column("Category", width="5cm") \
    .header_row()  # Theme handles all styling

MCP-Native Integration

The only spreadsheet library with native Model Context Protocol support:

You: "Create a Q1 budget spreadsheet with corporate theme"
Claude (via MCP): *generates professional ODS with formulas and formatting*

You: "Add a chart showing spending by category"
Claude (via MCP): *adds chart with proper data references*

Built for AI integration from day one—not retrofitted.

Format Freedom

One definition, any output:

  • ODS - Native format, open standard (LibreOffice, Collabora)
  • XLSX - Microsoft Excel compatibility
  • PDF - Distribution and reporting

Never be locked into a proprietary format.

Domain Expertise

11 specialized domains with 317+ formulas: Physics, Data Science, Engineering (electrical, mechanical, civil), Chemistry, Biology, Manufacturing, Finance, Education.

Domain expertise you don't have to recreate for every project. See Domain Plugins Documentation.


Documentation

User Guides

Tutorials

Learn step-by-step:

  1. Create Your First Spreadsheet
  2. Working with Data
  3. Domain Plugins
  4. Generate Reports
  5. MCP Integration
  6. Custom Themes

Technical Documentation

Examples

Working code in examples/:

  • Basic API usage, data import, report generation
  • Chart creation, theming, domain-specific examples
  • MCP integration from Python

Built-in Themes

Theme Description Style
default Clean professional Blue headers, green/red status
corporate Business-focused Navy blue, brown accents
minimal Distraction-free Gray headers, subtle borders
dark Dark mode Dark backgrounds, light text
high_contrast Accessibility Bold colors, large fonts

Create custom themes with YAML. See Theme Creation Guide.


Contributing

We welcome contributions! See CONTRIBUTING.md for development setup, coding standards, testing requirements, and commit message format.

For consistent messaging and terminology, see BRANDING.md.

Optional: This repo includes Claude Code configuration for AI-assisted development.


Security

SpreadsheetDL v0.1.0 includes comprehensive security hardening. See SECURITY.md for complete documentation.

Recommended installation (once published to PyPI):

uv pip install spreadsheet-dl[security]  # Includes defusedxml + cryptography

Current (from source):

uv sync  # Already includes security dependencies

License

MIT License - See LICENSE file.


Changelog

See CHANGELOG.md for detailed version history.

Recent releases:

  • v0.1.0 (2026-01-06) - Initial public beta: Feature-complete, seeking community feedback

Links

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

spreadsheet_dl-0.1.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

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

spreadsheet_dl-0.1.0-py3-none-any.whl (703.0 kB view details)

Uploaded Python 3

File details

Details for the file spreadsheet_dl-0.1.0.tar.gz.

File metadata

  • Download URL: spreadsheet_dl-0.1.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for spreadsheet_dl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eba76fe887872e21e882815cc22fc39225052b41789c233521a2ca2f376ca656
MD5 07db12e76d98212e0e749d8f45642a27
BLAKE2b-256 495781652bdbf5f8bf9eefdb23085b8df895989541ca737f6ad77ab45a17f828

See more details on using hashes here.

File details

Details for the file spreadsheet_dl-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: spreadsheet_dl-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 703.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for spreadsheet_dl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c992c14c441b75b90d1f4419cc35982c797291020fff50f12a105220366935c4
MD5 2257e881f10a4872ba9db1c4b019feaf
BLAKE2b-256 d8a0f792d7b8fdab2565fe2eadedb534394160b9dad9c0108e087c23da73c86b

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