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.6.tar.gz (6.2 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.6-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pulire-0.0.6.tar.gz
  • Upload date:
  • Size: 6.2 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.6.tar.gz
Algorithm Hash digest
SHA256 0f64090fb7b73d3560659fb46deb41f6b0541122cf6b582b249d4f548bf9a44b
MD5 7dd2a3aaf4502d227c2297dc205bae55
BLAKE2b-256 998fc8a344a659bc9b97afa10f26d95b88e63a5e76b54fe31263e7504b5ba974

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulire-0.0.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: pulire-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 12.0 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5d77fbd2565bc7fb9c9661d0e365f34df2860f7d94c2ff5881fc8ab720f2eaba
MD5 7c484faa2e585be1a7af9d246f2481f0
BLAKE2b-256 91f46d2f1b3b3aa7a2f358e98dfe794299c27ea0a04ac7a850c5219663ef0b3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulire-0.0.6-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