Framework de validação e limpeza de dados com PySpark
Project description
dq-engine
Framework PySpark para validacao e tratamento de qualidade de dados.
O que faz
- Resolve rule_set por nome de coluna
- Compila regras declarativas em expressoes Spark
- Gera score e status por coluna
- Aplica tratamento em lote
- Executa pipeline antes/depois com comparativo
Requisitos
- Python 3.10+
- PySpark 3.4+
Instalacao
pip install -e .
Uso rapido
from pyspark.sql import SparkSession
from dq_engine import DataQualityEngine
from dq_engine.config.conventions import CONVENTIONS
spark = SparkSession.builder.getOrCreate()
engine = DataQualityEngine(spark=spark, conventions=CONVENTIONS)
df = spark.table("lakehouse.clientes")
result = engine.validate_table(df=df, table_name="CLIENTES", run_id="2026-07-02")
result.output_df.orderBy("column_name").show(truncate=False)
Pipeline completo
df_tratado, result_before, result_after = engine.run_dq_pipeline(
df=df,
table_name="CLIENTES",
output_dir="/mnt/dq_output", # opcional
)
API principal
- DataQualityEngine.validate_table
- DataQualityEngine.apply_treatment
- DataQualityEngine.run_dq_pipeline
- DataQualityEngine.get_column_treatment_contexts
- DataQualityResult.table_summary
- DataQualityResult.failed_columns
Configuracao
Arquivo central de convencoes:
- src/dq_engine/config/conventions.py
Documentacao
- docs/architecture.md
- docs/rules.md
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
dq_engine-0.5.3.tar.gz
(37.0 kB
view details)
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
dq_engine-0.5.3-py3-none-any.whl
(42.5 kB
view details)
File details
Details for the file dq_engine-0.5.3.tar.gz.
File metadata
- Download URL: dq_engine-0.5.3.tar.gz
- Upload date:
- Size: 37.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e08a2f2991576e07a8ae9a9f80f5c2e1b1b2204d0ae844cdccf1e594c201f8e1
|
|
| MD5 |
765faf351d9758dd1d74329bbf34abb5
|
|
| BLAKE2b-256 |
aca3e919e5d27871094312208ed6dd64168e44047b3768a5fc3fa1021a12222a
|
File details
Details for the file dq_engine-0.5.3-py3-none-any.whl.
File metadata
- Download URL: dq_engine-0.5.3-py3-none-any.whl
- Upload date:
- Size: 42.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dda3f066a623749c1a7b85208d241e897bbcc3a205e7a7db0d95bae7ab16bcc4
|
|
| MD5 |
ec544bcea8b5176940ba52608fa83189
|
|
| BLAKE2b-256 |
f6704bbb1b9fe2f1774199bd504f9b25dca65fe9a5ebf584441e1bc2d919c687
|