Skip to main content

XLEA

xlea is a python library that makes it easy to convert Excel tables into ORM-like objects.

The library focised on schema-driven parsing of tabular data, where column resolution, validation and type conversion are handled explicitly and predictably.

⚠️ XLEA is a work in progress. The public API is stabilizing, and core concepts are already in place.

Features

  • Declarative schema definition

Describe tabular data using Python classes with type annotations and column descriptors.

  • Automatic column resolution

Columns are matched by name, regular expression, or custom predicate — no hard-coded indexes.

  • Type-driven value conversion

Cell values are automatically cast using schema type annotations with explicit error reporting.

  • Header-aware parsing

Support for multi-row headers and complex header layouts via schema configuration.

  • Pluggable provider architecture

File formats are handled by interchangeable providers, selected automatically by file extension.

  • Excel formats out of the box

Native support for .xlsx, .xls, and .xlsb via dedicated providers.

  • Row-level validation

Custom validators can be attached to columns to enforce domain-specific constraints.

  • Graceful handling of invalid data

Optionally skip rows with invalid values instead of failing the entire read.

Installation

pip install xlea

Example

Defining a Schema

from typing import Optional

from xlea import Schema, Column


age_name = lambda name: name.startswith("Age")
age_validator = lambda val: val.isnumeric()

@config(header_rows=2)
class Person(Schema):
    id: str = Column("ID")
    fullname: str = Column("Profile;Last Name, First Name", ignore_case=True)
    age: int = Column(age_name, validator=age_validator, skip_invalid_row=True)
    city: Optional[str] = Column("City", required=False, default="Voronezh")

Reading an Excel file

import xlea
from xlea.providers.openpyxl import OpenPyXlProvider

from schemas import Person


def main():
    persons = xlea.read(OpenPyXlProvider("test_data.xlsx"), schema=Person)
    # or with automatic provider selection
    persons = xlea.autoread("test_data.xlsx", schema=Person)

    for p in persons:
        print(p.id, p.fullname, p.age)


if __name__ == "__main__":
    main()

Metadata

Release files for xlea 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xlea 1.0.2
File Size Uploaded Provenance Actions
xlea-1.0.2.tar.gz 17.4 kB Without provenance Details for xlea-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xlea 1.0.2
File Interpreter ABI Platform Actions
xlea-1.0.2-py3-none-any.whl Python 3 none any Details for xlea-1.0.2-py3-none-any.whl

Total release size: 30.2 kB

Release files / xlea-1.0.2.tar.gz

Download URL xlea-1.0.2.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a61dc4681cb1fea43ed0f0e48e293704452977ae752883cd0f2881efc1045bd1
BLAKE2b-256 checksum
How to use checksums
381236a57026cccc7187adbdd0f5dabe7f370044e21dbad7470bbb7b94510792
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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":true}

Release files / xlea-1.0.2-py3-none-any.whl

Download URL xlea-1.0.2-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fe2d2182aa65ee982c907593baf9090bc8f2ca4cf62ea2c52e5dd436da29a36
BLAKE2b-256 checksum
How to use checksums
28e1b640834b49bd5b24e047137e8fc274b4e3b547d1871326b45cf7047debb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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":true}

Security for xlea 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page