Skip to main content

Schema-driven Python library for typed Excel import/export workflows with Pydantic and locale-aware workbooks.

Project description

ExcelAlchemy

Schema-driven Python library for typed Excel import/export workflows with Pydantic and locale-aware workbooks.

ExcelAlchemy turns Pydantic models into typed workbook contracts:

  • generate Excel templates from code
  • validate uploaded workbooks
  • map failures back to rows and cells
  • render workbook-facing output in zh-CN or en
  • keep storage pluggable through ExcelStorage

GitHub Repository · Full README · Architecture · Migration Notes

Screenshots

Template

Excel template screenshot

Import Result

Excel import result screenshot

Install

pip install ExcelAlchemy

Optional Minio support:

pip install "ExcelAlchemy[minio]"

Minimal Example

from pydantic import BaseModel

from excelalchemy import ExcelAlchemy, FieldMeta, ImporterConfig, Number, String


class Importer(BaseModel):
    age: Number = FieldMeta(label='Age', order=1)
    name: String = FieldMeta(label='Name', order=2)


alchemy = ExcelAlchemy(ImporterConfig(Importer, locale='en'))
template = alchemy.download_template_artifact(filename='people-template.xlsx')

excel_bytes = template.as_bytes()

Modern Annotated Example

from typing import Annotated

from pydantic import BaseModel, Field

from excelalchemy import Email, ExcelAlchemy, ExcelMeta, ImporterConfig


class Importer(BaseModel):
    email: Annotated[
        Email,
        Field(min_length=10),
        ExcelMeta(label='Email', order=1, hint='Use your work email'),
    ]


alchemy = ExcelAlchemy(ImporterConfig(Importer, locale='en'))
template = alchemy.download_template_artifact(filename='people-template.xlsx')

Why ExcelAlchemy

  • Pydantic v2-based schema extraction and validation
  • locale-aware workbook comments and result workbooks
  • pluggable storage instead of a hard-coded backend
  • openpyxl-based runtime path without pandas
  • contract tests, Ruff, and Pyright in the development workflow

Learn More

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

excelalchemy-2.1.0.tar.gz (52.7 kB view details)

Uploaded Source

Built Distribution

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

excelalchemy-2.1.0-py3-none-any.whl (81.0 kB view details)

Uploaded Python 3

File details

Details for the file excelalchemy-2.1.0.tar.gz.

File metadata

  • Download URL: excelalchemy-2.1.0.tar.gz
  • Upload date:
  • Size: 52.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for excelalchemy-2.1.0.tar.gz
Algorithm Hash digest
SHA256 d25750ef961089a60f0c4a697f66d0f21664c598be50995fd4b877465ee8ec65
MD5 5b3a3ee212df0ed84b3cb37eebcc2734
BLAKE2b-256 5e323f9b4337743d272aec87ef25c993a98ff29efe8c49d6988b254bee97c59c

See more details on using hashes here.

Provenance

The following attestation bundles were made for excelalchemy-2.1.0.tar.gz:

Publisher: python-publish.yml on RayCarterLab/ExcelAlchemy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file excelalchemy-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: excelalchemy-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 81.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for excelalchemy-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e695a439a88c5fb707b108e7a4fe908b00bb5f60a10cb9e6e8abea7a45cca62
MD5 8f578baba8a8f6221d5577be8cdee538
BLAKE2b-256 929a5e1b97d479c5252ab754950a1be795906122f9ff08fe9cb71d4dfb1b2f07

See more details on using hashes here.

Provenance

The following attestation bundles were made for excelalchemy-2.1.0-py3-none-any.whl:

Publisher: python-publish.yml on RayCarterLab/ExcelAlchemy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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