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-CNoren - keep storage pluggable through
ExcelStorage
The current stable release is 2.2.8, which continues the 2.x line with a clearer integration roadmap, stronger import-failure payload smoke verification, and more direct install-time validation of the FastAPI reference app.
GitHub Repository · Full README · Getting Started · Integration Roadmap · Result Objects · API Response Cookbook · Examples Showcase · Architecture · Migration Notes
Screenshots
Template
Import Result
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')
Example Outputs
These fixed outputs are generated from the repository examples by
scripts/generate_example_output_assets.py.
Import workflow:
Employee import workflow completed
Result: SUCCESS
Success rows: 1
Failed rows: 0
Result workbook URL: None
Created rows: 1
Uploaded artifacts: []
Export workflow:
Export workflow completed
Artifact filename: employees-export.xlsx
Artifact bytes: 6893
Upload URL: memory://employees-export-upload.xlsx
Uploaded objects: ['employees-export-upload.xlsx']
Full captured outputs:
- employee-import-workflow.txt
- create-or-update-import.txt
- export-workflow.txt
- date-and-range-fields.txt
- selection-fields.txt
- fastapi-reference.txt
For a single GitHub page that combines screenshots, representative workflows, and captured outputs, see the Examples Showcase.
If you want a copyable FastAPI-oriented reference layout rather than a single example script, see the FastAPI reference project.
Error Feedback
ExcelAlchemy keeps workbook-facing validation feedback readable while also supporting API-friendly inspection in application code.
The stable 2.x result surface includes:
alchemy.cell_error_mapalchemy.row_error_map
These objects remain dict-like for compatibility, but also expose helpers such as:
messages_at(...)messages_for_row(...)flatten()to_api_payload()
Common field types now also produce more business-oriented error wording, such as expected date formats, sample email/phone/URL formats, and clearer messages for configured selection fields.
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
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
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 excelalchemy-2.2.8.tar.gz.
File metadata
- Download URL: excelalchemy-2.2.8.tar.gz
- Upload date:
- Size: 64.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9da4b3479905e532826e628c851a76e0fa4bdd6457b8c85157a5ca10e998e751
|
|
| MD5 |
d27c4ad64b2229858c0efbe02fcdf382
|
|
| BLAKE2b-256 |
093c0a5152072e1f8b27718fc8ae8f12402d43af1bc8ee1e009e77235f9625ed
|
Provenance
The following attestation bundles were made for excelalchemy-2.2.8.tar.gz:
Publisher:
python-publish.yml on RayCarterLab/ExcelAlchemy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
excelalchemy-2.2.8.tar.gz -
Subject digest:
9da4b3479905e532826e628c851a76e0fa4bdd6457b8c85157a5ca10e998e751 - Sigstore transparency entry: 1237920533
- Sigstore integration time:
-
Permalink:
RayCarterLab/ExcelAlchemy@ed74f8ece25dc5a2a84ea7fbbcacdb005f9395b9 -
Branch / Tag:
refs/tags/v2.2.8 - Owner: https://github.com/RayCarterLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@ed74f8ece25dc5a2a84ea7fbbcacdb005f9395b9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file excelalchemy-2.2.8-py3-none-any.whl.
File metadata
- Download URL: excelalchemy-2.2.8-py3-none-any.whl
- Upload date:
- Size: 92.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd4b33d5f5cdc1d9e318a2b425ad1dea71f14bdc19fd878ca7a45dde1751322b
|
|
| MD5 |
08182d1b3666b75c7c7d060d58faa021
|
|
| BLAKE2b-256 |
c15e90a09cdd4ca6baec9aeae599ddc677f2579b28176e20436a3867f699c778
|
Provenance
The following attestation bundles were made for excelalchemy-2.2.8-py3-none-any.whl:
Publisher:
python-publish.yml on RayCarterLab/ExcelAlchemy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
excelalchemy-2.2.8-py3-none-any.whl -
Subject digest:
cd4b33d5f5cdc1d9e318a2b425ad1dea71f14bdc19fd878ca7a45dde1751322b - Sigstore transparency entry: 1237920536
- Sigstore integration time:
-
Permalink:
RayCarterLab/ExcelAlchemy@ed74f8ece25dc5a2a84ea7fbbcacdb005f9395b9 -
Branch / Tag:
refs/tags/v2.2.8 - Owner: https://github.com/RayCarterLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@ed74f8ece25dc5a2a84ea7fbbcacdb005f9395b9 -
Trigger Event:
release
-
Statement type: