Enterprise data quality toolkit — PII detection & masking, schema contracts, statistical profiling, and audit suites.
Project description
etlpipe-governance
Enterprise data quality toolkit — PII detection & masking, schema contracts, statistical profiling, and audit suites.
This is a standalone module of the etlpipe engine. It provides robust data governance tools designed to ensure data quality, regulatory compliance, and schema enforcement before data enters your core pipelines.
Installation
pip install etlpipe-governance
(Note: If you are using the full etlpipe execution engine, this module is already bundled and available natively without a separate install).
🛡️ 1. PII Detection & Masking (GDPR / HIPAA Compliance)
Automated detection of columns containing sensitive personal data (Emails, Phone numbers, SSNs, Credit Cards, IP Addresses, etc.) and robust masking strategies.
from etlpipe_governance import scan_pii, mask_pii
import pandas as pd
df = pd.read_csv("raw_users.csv")
# Step 1: Scan for PII (returns a DataFrame report of detected columns)
report = scan_pii(df)
print(report[["Column", "PII_Type", "Confidence"]])
# Step 2: Mask the detected PII before sharing or saving
# Strategy: "redact" (***REDACTED***)
safe_df = mask_pii(df, report, strategy="redact")
# Strategy: "hash" (SHA-256 for referential integrity)
hashed_df = mask_pii(df, report, strategy="hash")
# Strategy: "pseudonymise" (EMAIL_1, EMAIL_2, etc.)
pseudo_df, mapping_dict = mask_pii(df, report, strategy="pseudonymise", return_mapping=True)
📜 2. Schema Contracts
Enforce strict data type and nullability constraints at your pipeline boundaries. If bad data arrives, it fails loudly rather than silently propagating.
from etlpipe_governance import infer_schema, expect_schema, SchemaViolationError
# Bootstrap a schema from a known-good DataFrame
schema = infer_schema(good_df)
try:
# Enforce the schema on new incoming data
expect_schema(new_df, schema, strict=True)
except SchemaViolationError as e:
print(f"Pipeline halted! Violations: {e.violations}")
📊 3. Statistical Profiling
Go beyond data types to understand the shape, distribution, and health of your data.
from etlpipe_governance import profile
# Generate stats: null-rates, cardinality, min/max/mean, top-N values
stats_df = profile(df)
print(stats_df[["Column", "Null_Rate", "Unique_Count", "Top_Values"]])
🧪 4. Contract Suites
Compose multiple schema checks into a single audit run. This produces a combined pass/fail report suitable for Data Governance dashboards and Data Observability platforms.
from etlpipe_governance import ContractSuite
suite = ContractSuite("Daily Pipeline Audit")
suite.add_contract("raw_users", user_schema)
suite.add_contract("raw_transactions", txn_schema)
# Run the suite against a dictionary of DataFrames
results = suite.run({"raw_users": user_df, "raw_transactions": txn_df})
print(results) # Returns a DataFrame with pass/fail metrics per contract
Documentation
For full documentation, advanced usage, and engine integration, please visit the main repository: https://github.com/tonystark7cris/etlpipe
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 etlpipe_governance-0.1.0.tar.gz.
File metadata
- Download URL: etlpipe_governance-0.1.0.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98273afc568604b3fe03dccbfc85b171b7d01f7e126598b375490b7ae10e9086
|
|
| MD5 |
09a6fb5680027f2fd5abb690efa57dad
|
|
| BLAKE2b-256 |
f23bc381cf7dda68e8f648e7cb2c05f9b3d76b9d2af542dac003ead466b6c090
|
Provenance
The following attestation bundles were made for etlpipe_governance-0.1.0.tar.gz:
Publisher:
publish-governance.yml on tonystark7cris/etlpipe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
etlpipe_governance-0.1.0.tar.gz -
Subject digest:
98273afc568604b3fe03dccbfc85b171b7d01f7e126598b375490b7ae10e9086 - Sigstore transparency entry: 2237629002
- Sigstore integration time:
-
Permalink:
tonystark7cris/etlpipe@69ff03188d0c61e58eab355ae13131d67523ef7e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tonystark7cris
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-governance.yml@69ff03188d0c61e58eab355ae13131d67523ef7e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file etlpipe_governance-0.1.0-py3-none-any.whl.
File metadata
- Download URL: etlpipe_governance-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47870ac1b7cd95cd6f562f55063bd6b6a995c9afd850c58bcb364f5642b47b7c
|
|
| MD5 |
d711e505b74713a18fefeb00a15ba551
|
|
| BLAKE2b-256 |
dcd3207ed5826d6769b9b53f911821685a7f232b7ccd81476264b93e823c0480
|
Provenance
The following attestation bundles were made for etlpipe_governance-0.1.0-py3-none-any.whl:
Publisher:
publish-governance.yml on tonystark7cris/etlpipe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
etlpipe_governance-0.1.0-py3-none-any.whl -
Subject digest:
47870ac1b7cd95cd6f562f55063bd6b6a995c9afd850c58bcb364f5642b47b7c - Sigstore transparency entry: 2237629351
- Sigstore integration time:
-
Permalink:
tonystark7cris/etlpipe@69ff03188d0c61e58eab355ae13131d67523ef7e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tonystark7cris
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-governance.yml@69ff03188d0c61e58eab355ae13131d67523ef7e -
Trigger Event:
workflow_dispatch
-
Statement type: