Skip to main content

validoopsie

A simple and easy to use Data Validation library for Python.

validoopsie

PyPI version PyPI Downloads PyTest PyTest

Validoopsie

Validoopsie is a remarkably lightweight and user-friendly data validation library for Python. It’s designed to help you easily declare classes and chain validations together, in a style reminiscent of popular DataFrame libraries. This makes it a familiar and intuitive tool for developers who regularly work with dataframes.

Thanks to the excellent work by Narwhals, Validoopsie incorporates the "Bring Your Own DataFrame" (BYOD) concept. This flexibility allows you to use any DataFrame that Narwhals supports for your data validation tasks. To explore the full range of supported DataFrames, you can visit this link.

The syntax of Validoopsie has been thoughtfully crafted to ensure ease of use. Every validation function is encapsulated in its own method, which can be seamlessly linked together. This method-specific design prioritizes simplicity and readability, freeing you from the need to adapt to a new API each time you switch libraries. It allows you to focus on maintaining clean and understandable code.

Validoopsie draws significant inspiration from the Great Expectations library. It strives to distill the data validation process into something straightforward and efficient. Whether you're checking data integrity or ensuring compliance with data standards, Validoopsie provides a streamlined yet powerful solution to make these tasks accessible and straightforward.

Table of Contents

  1. Installation
  2. Getting Started
  3. License

Installation

  • pip

    pip install Validoopsie

Getting Started

Validoopsie is incredibly easy to use, so much so that you could do it half-asleep. The simplicity of the library is enhanced by the BYOD (Bring Your Own DataFrame) concept, where you merely need to utilize the Validate class and chain your desired validations together. This approach ensures that you can get started with minimal effort and without any unnecessary complexity.

import pandas as pd

from validoopsie import Validate

p_df = pd.DataFrame(
    {
        "name": ["John", "Doe", "Jane"],
        "target_name": ["John", "Doe", "Jane"],
        "last_name": ["Smith", "Smith", "Smith"],
        "age": [25, 30, 35],
    },
)

# `vd` stands for Validate Data
vd = Validate(p_df)
vd.EqualityValidation.PairColumnEquality(
    column="name",
    target_column="age",
    impact="high",
).UniqueValidation.ColumnUniqueValuesToBeInList(
    column="last_name",
    values=["Smith"],
).ValuesValidation.ColumnValuesToBeBetween(
    "age",
    20,
    40,
)

vd.results
OUTPUT
```json
{
  "Summary": {
    "passed": false,
    "validations": [
      "PairColumnEquality_name",
      "ColumnUniqueValuesToBeInList_last_name"
    ]
  },
  "PairColumnEquality_name": {
    "validation": "PairColumnEquality",
    "impact": "low",
    "timestamp": "2025-01-03T22:28:02.497324+01:00",
    "column": "name",
    "result": {
      "status": "Fail",
      "threshold pass": false,
      "message": "The column 'name' is not equal to the column'age'.",
      "failing items": [
        "Doe - column name - column age - 30",
        "Jane - column name - column age - 35",
        "John - column name - column age - 25"
      ],
      "failed number": 3,
      "frame row number": 3,
      "threshold": 0.0,
      "failed percentage": 1.0
    }
  },
  "ColumnUniqueValuesToBeInList_last_name": {
    "validation": "ColumnUniqueValuesToBeInList",
    "impact": "low",
    "timestamp": "2025-01-03T22:28:02.499192+01:00",
    "column": "last_name",
    "result": {
      "status": "Success",
      "threshold pass": true,
      "message": "All items passed the validation.",
      "frame row number": 3,
      "threshold": 0.0
    }
  }
}
```

To ensure that all your validations have been correctly executed and to handle any potential errors that may arise during the validation process, you can use the validate method. However, it's important to note that errors will only be raised if the impact level is set to high. Without this setting, potential issues may not trigger an error message.

NOTE: Raised error is a custom ValueError.

import pandas as pd

from validoopsie import Validate

p_df = pd.DataFrame(
    {
        "name": ["John", "Doe", "Jane"],
        "target_name": ["John", "Doe", "Jane"],
        "last_name": ["Smith", "Smith", "Smith"],
        "age": [25, 30, 35],
    },
)

# `vd` stands for Validate Data
vd = Validate(p_df)
vd.EqualityValidation.PairColumnEquality(
    column="name",
    target_column="age",
    impact="high",
).UniqueValidation.ColumnUniqueValuesToBeInList(
    column="last_name",
    values=["Smith"],
).ValuesValidation.ColumnValuesToBeBetween(
    "age",
    20,
    40,
).validate()

Thanks to loguru output will provide a very condenced information on validations and their status in a colorful way.

validation output

License

MIT © Validoopsie

Original Creator - Akmal Soliev

Metadata

Release files for Validoopsie 1.2.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 Validoopsie 1.2.0
File Size Uploaded Provenance Actions
validoopsie-1.2.0.tar.gz 17.0 kB With provenance Details for validoopsie-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Validoopsie 1.2.0
File Interpreter ABI Platform Actions
validoopsie-1.2.0-py3-none-any.whl Python 3 none any Details for validoopsie-1.2.0-py3-none-any.whl

Total release size: 53.0 kB

Release files / validoopsie-1.2.0.tar.gz

Download URL validoopsie-1.2.0.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
681b14592efbd45d736eb653951a29084c205a48a27207ee75b022786918dee8
BLAKE2b-256 checksum
How to use checksums
98a481ed549c31753dacbde845f168a2fa9bb0c63139c57a6cf69b40ad12eed8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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 Jan 31, 2025.

Transparency log

Release files / validoopsie-1.2.0-py3-none-any.whl

Download URL validoopsie-1.2.0-py3-none-any.whl
Size 36.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
823ec1db6760a7d9b433ff3347cf24d9396eea5f5bf05edb2020880d031d9405
BLAKE2b-256 checksum
How to use checksums
2d6890d8708d9e2104dc77af9ecbb27eff142b0dc71198bbbe2263136816cff2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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 Jan 31, 2025.

Transparency log

Security for Validoopsie 1.2.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for validoopsie-1.2.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 Jan 31, 2025.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 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