Skip to main content

A lightweight DataFrame validation library.

Project description

Pulire

A lightweight DataFrame validation library for Pandas.

Auto Formatting

poetry run black .

Testing

Run the following command for unit tests:

poetry run pytest tests

Schema

Pulire requires a Schema which describes all columns in a given DataFrame.

from pulire import Schema, Column, validators, formatters

Schema([
    Column("temp", "Float64", [
        validators.minimum(-80),
        validators.maximum(65),
        formatters.decimals(1)
    ])
])

Validate

Pulire automatically removes values which fail the validation. Let's use the meteostat library to get some data:

from datetime import datetime
from meteostat import Hourly

df = Hourly("10637", datetime(2018, 1, 1), datetime(2018, 1, 1, 23, 59)).fetch()

print(df)

Now, we can get a valid copy of our Meteostat DataFrame by running our schema's validate method:

df = myschema.validate(df)

Lazy Validations

try:
    schema.validate(df, lazy=True)
except ValueError as error:
    print(error.args[0])

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

pulire-0.0.7.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

pulire-0.0.7-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file pulire-0.0.7.tar.gz.

File metadata

  • Download URL: pulire-0.0.7.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pulire-0.0.7.tar.gz
Algorithm Hash digest
SHA256 b81b369806d6a8a6d46742851acb7a667a5f029a1ebc7c381ebd1d909204f303
MD5 ae6fe13cfb0119b3a22e6c9dcee7b632
BLAKE2b-256 05416c206138f8df653767e818678e21264560134bb8ec3a49537100379de556

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulire-0.0.7.tar.gz:

Publisher: publish.yml on meteostat/pulire

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

File details

Details for the file pulire-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: pulire-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pulire-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 86b314f4cc7e3c9b91a209dc4429934c8cc685d12428185b9c1c9faab46ef362
MD5 7a83bd87a1707ffbf02badf489812c9a
BLAKE2b-256 dc333df4992170f285a3e7af6d65a31ddcc4d22335cc47c17dba8fcd7e336ace

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulire-0.0.7-py3-none-any.whl:

Publisher: publish.yml on meteostat/pulire

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