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.4.tar.gz
(38.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.4-py3-none-any.whl
(43.5 kB
view details)
File details
Details for the file dq_engine-0.5.4.tar.gz.
File metadata
- Download URL: dq_engine-0.5.4.tar.gz
- Upload date:
- Size: 38.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 |
a73b98a5cf16d037e2f3ff6a325f4f29420f26e29409fa2252790e9c40a226d2
|
|
| MD5 |
d6d2ccd9a91b4ec856c2b29068614114
|
|
| BLAKE2b-256 |
fa54125ee181be19af4a4f9d46dd66dad616622f4b7fe90ef215a057acf8ef42
|
File details
Details for the file dq_engine-0.5.4-py3-none-any.whl.
File metadata
- Download URL: dq_engine-0.5.4-py3-none-any.whl
- Upload date:
- Size: 43.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 |
551bb87d31d29860a6ff5a6b712e92b8ecaea1f16c90f7ffaa32edb2c60ddb94
|
|
| MD5 |
bdcd282c324e0fd592def83f8cfac9a7
|
|
| BLAKE2b-256 |
563c69cafe16ee733242ebb220a77974a6c2dd94d95a40adecef5f4da6bc72a8
|