Skip to main content

Validate column specifications and constraints for SQL tables and polars data frames.

Project description

pydiverse.colspec

CI

A data validation library that ensures type conformity of columns in SQL tables and polars data frames. It can also validate constraints regarding the data as defined in a so-called column specification provided by the user.

The purpose is to make data pipelines more robust by ensuring that data meets expectations and more readable by adding type hints when working with tables and data frames.

ColSpec is founded on the ideas of dataframely which does exactly the same but with focus on polars data frames. ColSpec delegates to dataframely in the back especially for features like sampling random input data conforming to a given column specification. dataframely uses the term schema as it is also used in the polars community. Since ColSpec also works with SQL databases where the term schema is used for a collection of tables, the term is avoided as much as possible. The term column specification means exactly the same but avoids the confusion.

Merit attribution

ColSpec is the brain child of dataframely. Large parts of the codebase is code duplicated from it. Unfortunately, integrating the SQL native validation into dataframely would have made it a less clean solution for people who just focus on Polars. Thus the decision was made to replicate the same functionality in the pydiverse library collection also with the benefit to enable smoother integration with other pydiverse libraries.

Usage

pydiverse.colspec can either be installed via pypi with pip install pydiverse-colspec or via conda-forge with conda install pydiverse-colspec -c conda-forge. Our recommendation would be to use pixi which is also based on conda-forge:

mkdir my_project
pixi init
pixi add pydiverse-colspec

With pixi, you run python like this:

pixi run python -c 'import pydiverse.colspec'

or this:

pixi run python my_script.py

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

pydiverse_colspec-0.3.0.tar.gz (36.8 kB view details)

Uploaded Source

Built Distribution

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

pydiverse_colspec-0.3.0-py3-none-any.whl (56.0 kB view details)

Uploaded Python 3

File details

Details for the file pydiverse_colspec-0.3.0.tar.gz.

File metadata

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

File hashes

Hashes for pydiverse_colspec-0.3.0.tar.gz
Algorithm Hash digest
SHA256 cc9e1e94f132e3e4152b32a672496aaed9228a3a7999bcaa76b32d7774d9a72e
MD5 59cdc0d175ba2c530eaef8748fe216a6
BLAKE2b-256 a3f69802efd41197db3f8fae6928574bd24434a71e96a35825323d6f4c4105b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydiverse_colspec-0.3.0.tar.gz:

Publisher: release.yml on pydiverse/pydiverse.colspec

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

File details

Details for the file pydiverse_colspec-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pydiverse_colspec-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 928950f1043f441b0557ae5c46c9018a6f24c711c5792ba34a9941687c2f9dfd
MD5 798787b21194717e4f881cbc359ff526
BLAKE2b-256 6fcc1f6c1861b338627936206bab42169d39a467d6e122cb0aba1176e3536eff

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydiverse_colspec-0.3.0-py3-none-any.whl:

Publisher: release.yml on pydiverse/pydiverse.colspec

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