Skip to main content

polspec

Declare a Polars schema once. Generate data that matches it, and validate data against it — from the same declaration.

Early alpha. The API, the YAML format, and the exact values a given seed produces are all still moving. See Roadmap and stability before depending on any of it.

import polars as pl
from polspec import ColSpec, FrameSpec

class Orders(FrameSpec):
    order_id = ColSpec(pl.Int64, bounds=(1, None), unique=True)
    status   = ColSpec(pl.Enum(["NEW", "PAID", "SHIPPED"]))
    total    = ColSpec(pl.Float64, bounds=(0.0, None))
    placed   = ColSpec(pl.Date, nullable=True)

df = Orders.generate(1_000_000, seed=42)   # a million rows in well under a second
Orders.validate(df)                        # raises ValidationError on any breach

A validation library tells you when production data drifted, and Orders.drift(df) says what moved. A fixture library gives you something to test against. Keeping both behind one declaration means the fixtures and the contract cannot quietly disagree — and where they still can, it is written down in Known limitations, each backed by a test that fails the moment it stops being true.

The generator is a Rust extension that fills columns in parallel; validate() compiles every check across every column into a single Polars aggregation, so validating a wide table costs about the same as a narrow one. Numbers, and comparisons to NumPy and hand-written fixtures, are in Comparison.

Install

uv add polspec           # preferred
pip install polspec      # alternative

Wheels are published for Linux (x86_64, aarch64), macOS (Intel and Apple silicon) and Windows (x86_64), so using polspec needs no Rust toolchain. Building from a checkout is covered in CONTRIBUTING.md.

Documentation

Full docs: maxwellb13.github.io/polspec. Start with Getting started, find a task among the how-to guides, or look a name up in the API reference.

Development

Setting up a checkout, the checks CI runs, the conventions and the release process are in CONTRIBUTING.md; what changed is in CHANGELOG.md.

License

MIT.

Metadata

Release files for polspec 0.13.0

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

Source distribution (sdist)

Source distribution for polspec 0.13.0
File Size Uploaded Provenance
polspec-0.13.0.tar.gz 714.5 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for polspec 0.13.0
File
polspec-0.13.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
polspec-0.13.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details
polspec-0.13.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details
polspec-0.13.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
polspec-0.13.0-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details

Total release size: 30.1 MB

Release files / polspec-0.13.0.tar.gz

Download URL polspec-0.13.0.tar.gz
Size 714.5 kB
Tags Source
SHA-256 checksum
How to use checksums
35b7f24d5f9bd9d9b9efafab048a11859e63b3833ebe0104c1917384bb27a5ef
BLAKE2b-256 checksum
How to use checksums
bf5d3b2fa66ed4c2b978dcdba8ba48d99e8067a0e2cba7fcbbc0f9aac6f40b1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / polspec-0.13.0-cp312-abi3-win_amd64.whl

Download URL polspec-0.13.0-cp312-abi3-win_amd64.whl
Size 6.3 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1eff674e23d6575c03fdb348633075e542175787feffbc598653479e95dcc510
BLAKE2b-256 checksum
How to use checksums
66ee78e18c79783b2aed3e43bf0275c6d1398a682221f8c52769b0f13cb07be6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / polspec-0.13.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL polspec-0.13.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.1 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
210a115ad045890cfd5d20fadf69c8a9c95dd146880aaf238bf4ce6131ee323b
BLAKE2b-256 checksum
How to use checksums
818e8f08e8644803445e4204949742169f0a081059e14daacc26e16ab3c8d8e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / polspec-0.13.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL polspec-0.13.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 5.6 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
b126de5983da36971f3cdaf5e276450ab1e98c7610a39c769f9812b3d506b5a2
BLAKE2b-256 checksum
How to use checksums
bffb2104a86f3e2aba8f703d7ec1f0d529e49dfee8765683f3f440fcb1abb3b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / polspec-0.13.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL polspec-0.13.0-cp312-abi3-macosx_11_0_arm64.whl
Size 5.4 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8900ffa19eac63863835832d7cb14426388bb719aadff60082945b03dfdc3185
BLAKE2b-256 checksum
How to use checksums
329f51c568013bf13414ff92c58e316b2bf0ced7635149d5dd429dcd837bde17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Release files / polspec-0.13.0-cp312-abi3-macosx_10_12_x86_64.whl

Download URL polspec-0.13.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 6.0 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
596101b53f0ccf0559b8a1e9684c981dbe4a953922fe8c81d49eac5a3fb66f6b
BLAKE2b-256 checksum
How to use checksums
b09f1d314d546f42615bd6aa7b75af57a18bc3c8357ffa741550b3b12f059a2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

Security for polspec 0.13.0

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for polspec-0.13.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.13.0 This release

6 release files Full provenance

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