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.15.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.15.0
File Size Uploaded Provenance
polspec-0.15.0.tar.gz 644.1 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for polspec 0.15.0
File
polspec-0.15.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
polspec-0.15.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.15.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details
polspec-0.15.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
polspec-0.15.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.15.0.tar.gz

Download URL polspec-0.15.0.tar.gz
Size 644.1 kB
Tags Source
SHA-256 checksum
How to use checksums
62ef91dd3659c9a86bbd3800444ea2c36fdfa393cdeec33b9ecdfde82a552256
BLAKE2b-256 checksum
How to use checksums
cde4afcdd1a4c9f5344f87adca1ca59d1d243dcc1af498a32fe1cffc8ea6a61c
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 Oct 4, 2026.

Transparency log

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

Download URL polspec-0.15.0-cp312-abi3-win_amd64.whl
Size 6.4 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b06a665084c8b79bd851d46928fe5a2cdb1e4db8df25413f2a43e4bbbda4acb8
BLAKE2b-256 checksum
How to use checksums
6b397e793823fe313123bc99e41a63691a49bc186c7d8f1560ea4acfa11b6983
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 Oct 4, 2026.

Transparency log

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

Download URL polspec-0.15.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
b43d29a42b148d38602e74a477f3f3b26558a864daccb0ee8403cb4ff87e7d6d
BLAKE2b-256 checksum
How to use checksums
44848ceaaf8678c77a89d282cb0b83fbd604d541f405ad8a01d62570fa5a2775
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 Oct 4, 2026.

Transparency log

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

Download URL polspec-0.15.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
cb387a2d5c455e82107922c5277598c2bbcf10f9863989da3787ac5a0021ae35
BLAKE2b-256 checksum
How to use checksums
f1c4e1899dd6e3a63c4d08f83e9a7b21ba944564a4f674b403a8ef406179a4a1
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 Oct 4, 2026.

Transparency log

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

Download URL polspec-0.15.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
1e15cc81b11ec298d34a65e4d4798e432c5eb6759c89c75c9da10122ccb43d3d
BLAKE2b-256 checksum
How to use checksums
679e10f1a3ce905a44bafdc0472c16fbc107e6eb726b2272a9d3a7158eff10dd
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 Oct 4, 2026.

Transparency log

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

Download URL polspec-0.15.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
4a9683d3f1ec92b63a6b1b899fec954268dffd98d4c0339450c21345bffe10e2
BLAKE2b-256 checksum
How to use checksums
ac83a1d2cc89c1cdd67d7c1ed306478fc166d73088270118960e7f831de4af98
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 Oct 4, 2026.

Transparency log

Security for polspec 0.15.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.15.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 Oct 4, 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.15.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