Skip to main content

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


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.0.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dq_engine-0.5.0-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file dq_engine-0.5.0.tar.gz.

File metadata

  • Download URL: dq_engine-0.5.0.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for dq_engine-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a54a7be1794b1c0335234c3b0864e05ec9c9c974812e92f6f6fc18bec08da78f
MD5 3eedec457b873d3d75ff106531795975
BLAKE2b-256 fbc82f91571204f430f843dcd37c4b1432b7c443ff0bba691959a498dfe67762

See more details on using hashes here.

File details

Details for the file dq_engine-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: dq_engine-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for dq_engine-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dcc19c2ae55e901397d14956dec43bed56d67319b1b39839745fdd9cba0dcd1b
MD5 495cd8b2e2b7541eca57d4b72e332083
BLAKE2b-256 283f61d786af0a92c75ff51f659cb0ef7ae70ab600c5236dde808d8b15977878

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page