A YAML-driven data validation library with HTML reports.
Project description
validater
validater is a YAML-driven data validation tool for checking datasets and producing an HTML report.
For a full step-by-step guide, see docs.md.
Supported Sources
validater currently supports:
- CSV files.
- Microsoft SQL Server.
Planned source support includes more relational databases, Excel workbooks, and Parquet files.
Install
pip install validater-data
For local development:
pip install -e ".[dev]"
To validate data from Microsoft SQL Server:
pip install "validater-data[mssql]"
Create rules.yaml
name: Validate Workouts
description: Checks required fields before ingestion
source:
type: csv
path: ./data/workouts.csv
checks:
- column: title
type: not_null
severity: error
- column: reps
type: not_null
severity: warn
For Microsoft SQL Server, use either table or query. Prefer connection_string_env so credentials are not committed to source control.
name: Validate Users
source:
type: mssql
connection_string_env: VALIDATER_MSSQL_URL
schema: dbo
table: users
checks:
- column: user_id
type: primary_key
- column: email
type: regex
pattern: '^[\w\.-]+@[\w\.-]+\.\w+$'
Use filters when only part of a table should be validated. Multiple filters are combined with AND.
name: Validate Active Customers
source:
type: mssql
connection_string_env: VALIDATER_MSSQL_URL
schema: dbo
table: customers
filters:
- column: ACTIVE_FLAG
operator: "="
value: "Y"
- column: COUNTRY
operator: "in"
value: ["US", "CA"]
- column: DELETED_AT
operator: "is_null"
checks:
- column: customer_id
type: primary_key
- column: email
type: regex
pattern: '^[\w\.-]+@[\w\.-]+\.\w+$'
Supported filter operators are =, !=, >, >=, <, <=, in, not_in, is_null, and is_not_null.
name: Validate Recent Orders
source:
type: mssql
connection_string_env: VALIDATER_MSSQL_URL
query: |
SELECT order_id, customer_id, order_total, discount_total
FROM dbo.orders
WHERE created_at >= DATEADD(day, -1, SYSUTCDATETIME())
checks:
- column: order_id
type: primary_key
- column: order_total
type: column_dependency
operator: ">="
right_column: discount_total
filters are available for table-based MS SQL sources. For advanced filtering, joins, grouped AND/OR logic, or warehouse-specific SQL, use query.
Supported Checks
validater currently supports these checks:
not_null: column values must not be null.regex: non-null column values must match a regex pattern.unique: a column, or set of columns, must be unique.unique_combination: alias for multi-column uniqueness.primary_key: a single column must be non-null and unique.composite_primary_key: multiple columns must be non-null and unique together.column_dependency: compare two columns row by row, such asmax_value > min_value.
Example:
checks:
- column: email
type: regex
pattern: '^[\w\.-]+@[\w\.-]+\.\w+$'
- column: user_id
type: primary_key
- columns: [user_id, created_at]
type: composite_primary_key
- columns: [user_id, event_name]
type: unique_combination
- column: max_value
type: column_dependency
operator: ">"
right_column: min_value
Run
validater /path/to/rules.yaml
validater exits with a non-zero status when an error severity check fails, so it can be used in CI pipelines. A report is written to reports/.
The misspelled command validaer is also installed as a compatibility alias.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file validater_data-0.1.0.tar.gz.
File metadata
- Download URL: validater_data-0.1.0.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cc2ea13a3cee8b942834cca128b7fce4f527c6abda1eb5d7fe956c5eb5d3b0f
|
|
| MD5 |
6a5119fada54a3dc35ab13b80f114ba6
|
|
| BLAKE2b-256 |
22e6456d76cab06a945dd1be89b2c574d6e5ccca45d817ac72c9fd273ecdbb00
|
Provenance
The following attestation bundles were made for validater_data-0.1.0.tar.gz:
Publisher:
publish.yml on VibhavSurve09/validater
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
validater_data-0.1.0.tar.gz -
Subject digest:
2cc2ea13a3cee8b942834cca128b7fce4f527c6abda1eb5d7fe956c5eb5d3b0f - Sigstore transparency entry: 1554088473
- Sigstore integration time:
-
Permalink:
VibhavSurve09/validater@7c256f80aee124086bb2df44dff1b92af1565748 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/VibhavSurve09
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7c256f80aee124086bb2df44dff1b92af1565748 -
Trigger Event:
release
-
Statement type:
File details
Details for the file validater_data-0.1.0-py3-none-any.whl.
File metadata
- Download URL: validater_data-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35298e1655e4e2f7d6053ff2fe76ae17d585d5e1a44509f12dbaa508b120bc0b
|
|
| MD5 |
ca4120d4415a85ef1b3eed9f3ac31664
|
|
| BLAKE2b-256 |
f6cd8edaa5ac15ea0cb925fe47c4934116a48371778684adb73cf8fbd0e3a014
|
Provenance
The following attestation bundles were made for validater_data-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on VibhavSurve09/validater
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
validater_data-0.1.0-py3-none-any.whl -
Subject digest:
35298e1655e4e2f7d6053ff2fe76ae17d585d5e1a44509f12dbaa508b120bc0b - Sigstore transparency entry: 1554088500
- Sigstore integration time:
-
Permalink:
VibhavSurve09/validater@7c256f80aee124086bb2df44dff1b92af1565748 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/VibhavSurve09
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7c256f80aee124086bb2df44dff1b92af1565748 -
Trigger Event:
release
-
Statement type: