pycharter 0.0.22__py3-none-any.whl → 0.0.24__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- api/main.py +27 -1
- api/models/docs.py +68 -0
- api/models/evolution.py +117 -0
- api/models/tracking.py +111 -0
- api/models/validation.py +46 -6
- api/routes/v1/__init__.py +14 -1
- api/routes/v1/docs.py +187 -0
- api/routes/v1/evolution.py +337 -0
- api/routes/v1/templates.py +211 -27
- api/routes/v1/tracking.py +301 -0
- api/routes/v1/validation.py +68 -31
- pycharter/__init__.py +268 -58
- pycharter/data/templates/contract/template_coercion_rules.yaml +57 -0
- pycharter/data/templates/contract/template_contract.yaml +122 -0
- pycharter/data/templates/contract/template_metadata.yaml +68 -0
- pycharter/data/templates/contract/template_schema.yaml +100 -0
- pycharter/data/templates/contract/template_validation_rules.yaml +75 -0
- pycharter/data/templates/etl/README.md +224 -0
- pycharter/data/templates/etl/extract_cloud_azure.yaml +24 -0
- pycharter/data/templates/etl/extract_cloud_gcs.yaml +25 -0
- pycharter/data/templates/etl/extract_cloud_s3.yaml +30 -0
- pycharter/data/templates/etl/extract_database.yaml +34 -0
- pycharter/data/templates/etl/extract_database_ssh.yaml +40 -0
- pycharter/data/templates/etl/extract_file_csv.yaml +21 -0
- pycharter/data/templates/etl/extract_file_glob.yaml +25 -0
- pycharter/data/templates/etl/extract_file_json.yaml +24 -0
- pycharter/data/templates/etl/extract_file_parquet.yaml +20 -0
- pycharter/data/templates/etl/extract_http_paginated.yaml +79 -0
- pycharter/data/templates/etl/extract_http_path_params.yaml +38 -0
- pycharter/data/templates/etl/extract_http_simple.yaml +62 -0
- pycharter/data/templates/etl/load_cloud_azure.yaml +24 -0
- pycharter/data/templates/etl/load_cloud_gcs.yaml +22 -0
- pycharter/data/templates/etl/load_cloud_s3.yaml +27 -0
- pycharter/data/templates/etl/load_file.yaml +34 -0
- pycharter/data/templates/etl/load_insert.yaml +18 -0
- pycharter/data/templates/etl/load_postgresql.yaml +39 -0
- pycharter/data/templates/etl/load_sqlite.yaml +21 -0
- pycharter/data/templates/etl/load_truncate_and_load.yaml +20 -0
- pycharter/data/templates/etl/load_upsert.yaml +25 -0
- pycharter/data/templates/etl/load_with_dlq.yaml +34 -0
- pycharter/data/templates/etl/load_with_ssh_tunnel.yaml +35 -0
- pycharter/data/templates/etl/pipeline_http_to_db.yaml +75 -0
- pycharter/data/templates/etl/transform_combined.yaml +48 -0
- pycharter/data/templates/etl/transform_custom_function.yaml +58 -0
- pycharter/data/templates/etl/transform_jsonata.yaml +51 -0
- pycharter/data/templates/etl/transform_simple.yaml +59 -0
- pycharter/db/schemas/.ipynb_checkpoints/data_contract-checkpoint.py +160 -0
- pycharter/docs_generator/__init__.py +43 -0
- pycharter/docs_generator/generator.py +465 -0
- pycharter/docs_generator/renderers.py +247 -0
- pycharter/etl_generator/__init__.py +168 -80
- pycharter/etl_generator/builder.py +121 -0
- pycharter/etl_generator/config_loader.py +394 -0
- pycharter/etl_generator/config_validator.py +418 -0
- pycharter/etl_generator/context.py +132 -0
- pycharter/etl_generator/expression.py +499 -0
- pycharter/etl_generator/extractors/__init__.py +30 -0
- pycharter/etl_generator/extractors/base.py +70 -0
- pycharter/etl_generator/extractors/cloud_storage.py +530 -0
- pycharter/etl_generator/extractors/database.py +221 -0
- pycharter/etl_generator/extractors/factory.py +185 -0
- pycharter/etl_generator/extractors/file.py +475 -0
- pycharter/etl_generator/extractors/http.py +895 -0
- pycharter/etl_generator/extractors/streaming.py +57 -0
- pycharter/etl_generator/loaders/__init__.py +41 -0
- pycharter/etl_generator/loaders/base.py +35 -0
- pycharter/etl_generator/loaders/cloud.py +87 -0
- pycharter/etl_generator/loaders/cloud_storage_loader.py +275 -0
- pycharter/etl_generator/loaders/database.py +274 -0
- pycharter/etl_generator/loaders/factory.py +180 -0
- pycharter/etl_generator/loaders/file.py +72 -0
- pycharter/etl_generator/loaders/file_loader.py +130 -0
- pycharter/etl_generator/pipeline.py +743 -0
- pycharter/etl_generator/protocols.py +54 -0
- pycharter/etl_generator/result.py +63 -0
- pycharter/etl_generator/schemas/__init__.py +49 -0
- pycharter/etl_generator/transformers/__init__.py +49 -0
- pycharter/etl_generator/transformers/base.py +63 -0
- pycharter/etl_generator/transformers/config.py +45 -0
- pycharter/etl_generator/transformers/custom_function.py +101 -0
- pycharter/etl_generator/transformers/jsonata_transformer.py +56 -0
- pycharter/etl_generator/transformers/operations.py +218 -0
- pycharter/etl_generator/transformers/pipeline.py +54 -0
- pycharter/etl_generator/transformers/simple_operations.py +131 -0
- pycharter/quality/__init__.py +25 -0
- pycharter/quality/tracking/__init__.py +64 -0
- pycharter/quality/tracking/collector.py +318 -0
- pycharter/quality/tracking/exporters.py +238 -0
- pycharter/quality/tracking/models.py +194 -0
- pycharter/quality/tracking/store.py +385 -0
- pycharter/runtime_validator/__init__.py +20 -7
- pycharter/runtime_validator/builder.py +328 -0
- pycharter/runtime_validator/validator.py +311 -7
- pycharter/runtime_validator/validator_core.py +61 -0
- pycharter/schema_evolution/__init__.py +61 -0
- pycharter/schema_evolution/compatibility.py +270 -0
- pycharter/schema_evolution/diff.py +496 -0
- pycharter/schema_evolution/models.py +201 -0
- pycharter/shared/__init__.py +56 -0
- pycharter/shared/errors.py +296 -0
- pycharter/shared/protocols.py +234 -0
- {pycharter-0.0.22.dist-info → pycharter-0.0.24.dist-info}/METADATA +146 -26
- pycharter-0.0.24.dist-info/RECORD +543 -0
- {pycharter-0.0.22.dist-info → pycharter-0.0.24.dist-info}/WHEEL +1 -1
- ui/static/404/index.html +1 -1
- ui/static/404.html +1 -1
- ui/static/__next.__PAGE__.txt +1 -1
- ui/static/__next._full.txt +1 -1
- ui/static/__next._head.txt +1 -1
- ui/static/__next._index.txt +1 -1
- ui/static/__next._tree.txt +1 -1
- ui/static/_next/static/chunks/26dfc590f7714c03.js +1 -0
- ui/static/_next/static/chunks/34d289e6db2ef551.js +1 -0
- ui/static/_next/static/chunks/99508d9d5869cc27.js +1 -0
- ui/static/_next/static/chunks/b313c35a6ba76574.js +1 -0
- ui/static/_not-found/__next._full.txt +1 -1
- ui/static/_not-found/__next._head.txt +1 -1
- ui/static/_not-found/__next._index.txt +1 -1
- ui/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
- ui/static/_not-found/__next._not-found.txt +1 -1
- ui/static/_not-found/__next._tree.txt +1 -1
- ui/static/_not-found/index.html +1 -1
- ui/static/_not-found/index.txt +1 -1
- ui/static/contracts/__next._full.txt +2 -2
- ui/static/contracts/__next._head.txt +1 -1
- ui/static/contracts/__next._index.txt +1 -1
- ui/static/contracts/__next._tree.txt +1 -1
- ui/static/contracts/__next.contracts.__PAGE__.txt +2 -2
- ui/static/contracts/__next.contracts.txt +1 -1
- ui/static/contracts/index.html +1 -1
- ui/static/contracts/index.txt +2 -2
- ui/static/documentation/__next._full.txt +1 -1
- ui/static/documentation/__next._head.txt +1 -1
- ui/static/documentation/__next._index.txt +1 -1
- ui/static/documentation/__next._tree.txt +1 -1
- ui/static/documentation/__next.documentation.__PAGE__.txt +1 -1
- ui/static/documentation/__next.documentation.txt +1 -1
- ui/static/documentation/index.html +2 -2
- ui/static/documentation/index.txt +1 -1
- ui/static/index.html +1 -1
- ui/static/index.txt +1 -1
- ui/static/metadata/__next._full.txt +1 -1
- ui/static/metadata/__next._head.txt +1 -1
- ui/static/metadata/__next._index.txt +1 -1
- ui/static/metadata/__next._tree.txt +1 -1
- ui/static/metadata/__next.metadata.__PAGE__.txt +1 -1
- ui/static/metadata/__next.metadata.txt +1 -1
- ui/static/metadata/index.html +1 -1
- ui/static/metadata/index.txt +1 -1
- ui/static/quality/__next._full.txt +2 -2
- ui/static/quality/__next._head.txt +1 -1
- ui/static/quality/__next._index.txt +1 -1
- ui/static/quality/__next._tree.txt +1 -1
- ui/static/quality/__next.quality.__PAGE__.txt +2 -2
- ui/static/quality/__next.quality.txt +1 -1
- ui/static/quality/index.html +2 -2
- ui/static/quality/index.txt +2 -2
- ui/static/rules/__next._full.txt +1 -1
- ui/static/rules/__next._head.txt +1 -1
- ui/static/rules/__next._index.txt +1 -1
- ui/static/rules/__next._tree.txt +1 -1
- ui/static/rules/__next.rules.__PAGE__.txt +1 -1
- ui/static/rules/__next.rules.txt +1 -1
- ui/static/rules/index.html +1 -1
- ui/static/rules/index.txt +1 -1
- ui/static/schemas/__next._full.txt +1 -1
- ui/static/schemas/__next._head.txt +1 -1
- ui/static/schemas/__next._index.txt +1 -1
- ui/static/schemas/__next._tree.txt +1 -1
- ui/static/schemas/__next.schemas.__PAGE__.txt +1 -1
- ui/static/schemas/__next.schemas.txt +1 -1
- ui/static/schemas/index.html +1 -1
- ui/static/schemas/index.txt +1 -1
- ui/static/settings/__next._full.txt +1 -1
- ui/static/settings/__next._head.txt +1 -1
- ui/static/settings/__next._index.txt +1 -1
- ui/static/settings/__next._tree.txt +1 -1
- ui/static/settings/__next.settings.__PAGE__.txt +1 -1
- ui/static/settings/__next.settings.txt +1 -1
- ui/static/settings/index.html +1 -1
- ui/static/settings/index.txt +1 -1
- ui/static/static/404/index.html +1 -1
- ui/static/static/404.html +1 -1
- ui/static/static/__next.__PAGE__.txt +1 -1
- ui/static/static/__next._full.txt +2 -2
- ui/static/static/__next._head.txt +1 -1
- ui/static/static/__next._index.txt +2 -2
- ui/static/static/__next._tree.txt +2 -2
- ui/static/static/_next/static/chunks/13d4a0fbd74c1ee4.js +1 -0
- ui/static/static/_next/static/chunks/2edb43b48432ac04.js +441 -0
- ui/static/static/_next/static/chunks/d2363397e1b2bcab.css +1 -0
- ui/static/static/_next/static/chunks/f7d1a90dd75d2572.js +1 -0
- ui/static/static/_not-found/__next._full.txt +2 -2
- ui/static/static/_not-found/__next._head.txt +1 -1
- ui/static/static/_not-found/__next._index.txt +2 -2
- ui/static/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
- ui/static/static/_not-found/__next._not-found.txt +1 -1
- ui/static/static/_not-found/__next._tree.txt +2 -2
- ui/static/static/_not-found/index.html +1 -1
- ui/static/static/_not-found/index.txt +2 -2
- ui/static/static/contracts/__next._full.txt +3 -3
- ui/static/static/contracts/__next._head.txt +1 -1
- ui/static/static/contracts/__next._index.txt +2 -2
- ui/static/static/contracts/__next._tree.txt +2 -2
- ui/static/static/contracts/__next.contracts.__PAGE__.txt +2 -2
- ui/static/static/contracts/__next.contracts.txt +1 -1
- ui/static/static/contracts/index.html +1 -1
- ui/static/static/contracts/index.txt +3 -3
- ui/static/static/documentation/__next._full.txt +3 -3
- ui/static/static/documentation/__next._head.txt +1 -1
- ui/static/static/documentation/__next._index.txt +2 -2
- ui/static/static/documentation/__next._tree.txt +2 -2
- ui/static/static/documentation/__next.documentation.__PAGE__.txt +2 -2
- ui/static/static/documentation/__next.documentation.txt +1 -1
- ui/static/static/documentation/index.html +2 -2
- ui/static/static/documentation/index.txt +3 -3
- ui/static/static/index.html +1 -1
- ui/static/static/index.txt +2 -2
- ui/static/static/metadata/__next._full.txt +2 -2
- ui/static/static/metadata/__next._head.txt +1 -1
- ui/static/static/metadata/__next._index.txt +2 -2
- ui/static/static/metadata/__next._tree.txt +2 -2
- ui/static/static/metadata/__next.metadata.__PAGE__.txt +1 -1
- ui/static/static/metadata/__next.metadata.txt +1 -1
- ui/static/static/metadata/index.html +1 -1
- ui/static/static/metadata/index.txt +2 -2
- ui/static/static/quality/__next._full.txt +2 -2
- ui/static/static/quality/__next._head.txt +1 -1
- ui/static/static/quality/__next._index.txt +2 -2
- ui/static/static/quality/__next._tree.txt +2 -2
- ui/static/static/quality/__next.quality.__PAGE__.txt +1 -1
- ui/static/static/quality/__next.quality.txt +1 -1
- ui/static/static/quality/index.html +2 -2
- ui/static/static/quality/index.txt +2 -2
- ui/static/static/rules/__next._full.txt +2 -2
- ui/static/static/rules/__next._head.txt +1 -1
- ui/static/static/rules/__next._index.txt +2 -2
- ui/static/static/rules/__next._tree.txt +2 -2
- ui/static/static/rules/__next.rules.__PAGE__.txt +1 -1
- ui/static/static/rules/__next.rules.txt +1 -1
- ui/static/static/rules/index.html +1 -1
- ui/static/static/rules/index.txt +2 -2
- ui/static/static/schemas/__next._full.txt +2 -2
- ui/static/static/schemas/__next._head.txt +1 -1
- ui/static/static/schemas/__next._index.txt +2 -2
- ui/static/static/schemas/__next._tree.txt +2 -2
- ui/static/static/schemas/__next.schemas.__PAGE__.txt +1 -1
- ui/static/static/schemas/__next.schemas.txt +1 -1
- ui/static/static/schemas/index.html +1 -1
- ui/static/static/schemas/index.txt +2 -2
- ui/static/static/settings/__next._full.txt +2 -2
- ui/static/static/settings/__next._head.txt +1 -1
- ui/static/static/settings/__next._index.txt +2 -2
- ui/static/static/settings/__next._tree.txt +2 -2
- ui/static/static/settings/__next.settings.__PAGE__.txt +1 -1
- ui/static/static/settings/__next.settings.txt +1 -1
- ui/static/static/settings/index.html +1 -1
- ui/static/static/settings/index.txt +2 -2
- ui/static/static/static/.gitkeep +0 -0
- ui/static/static/static/404/index.html +1 -0
- ui/static/static/static/404.html +1 -0
- ui/static/static/static/__next.__PAGE__.txt +10 -0
- ui/static/static/static/__next._full.txt +30 -0
- ui/static/static/static/__next._head.txt +7 -0
- ui/static/static/static/__next._index.txt +9 -0
- ui/static/static/static/__next._tree.txt +2 -0
- ui/static/static/static/_next/static/chunks/222442f6da32302a.js +1 -0
- ui/static/static/static/_next/static/chunks/247eb132b7f7b574.js +1 -0
- ui/static/static/static/_next/static/chunks/297d55555b71baba.js +1 -0
- ui/static/static/static/_next/static/chunks/2ab439ce003cd691.js +1 -0
- ui/static/static/static/_next/static/chunks/414e77373f8ff61c.js +1 -0
- ui/static/static/static/_next/static/chunks/49ca65abd26ae49e.js +1 -0
- ui/static/static/static/_next/static/chunks/652ad0aa26265c47.js +2 -0
- ui/static/static/static/_next/static/chunks/9667e7a3d359eb39.js +1 -0
- ui/static/static/static/_next/static/chunks/9c23f44fff36548a.js +1 -0
- ui/static/static/static/_next/static/chunks/a6dad97d9634a72d.js +1 -0
- ui/static/static/static/_next/static/chunks/b32a0963684b9933.js +4 -0
- ui/static/static/static/_next/static/chunks/c69f6cba366bd988.js +1 -0
- ui/static/static/static/_next/static/chunks/db913959c675cea6.js +1 -0
- ui/static/static/static/_next/static/chunks/f061a4be97bfc3b3.js +1 -0
- ui/static/static/static/_next/static/chunks/f2e7afeab1178138.js +1 -0
- ui/static/static/static/_next/static/chunks/ff1a16fafef87110.js +1 -0
- ui/static/static/static/_next/static/chunks/turbopack-ffcb7ab6794027ef.js +3 -0
- ui/static/static/static/_next/static/tNTkVW6puVXC4bAm4WrHl/_buildManifest.js +11 -0
- ui/static/static/static/_next/static/tNTkVW6puVXC4bAm4WrHl/_ssgManifest.js +1 -0
- ui/static/static/static/_not-found/__next._full.txt +17 -0
- ui/static/static/static/_not-found/__next._head.txt +7 -0
- ui/static/static/static/_not-found/__next._index.txt +9 -0
- ui/static/static/static/_not-found/__next._not-found.__PAGE__.txt +5 -0
- ui/static/static/static/_not-found/__next._not-found.txt +4 -0
- ui/static/static/static/_not-found/__next._tree.txt +2 -0
- ui/static/static/static/_not-found/index.html +1 -0
- ui/static/static/static/_not-found/index.txt +17 -0
- ui/static/static/static/contracts/__next._full.txt +21 -0
- ui/static/static/static/contracts/__next._head.txt +7 -0
- ui/static/static/static/contracts/__next._index.txt +9 -0
- ui/static/static/static/contracts/__next._tree.txt +2 -0
- ui/static/static/static/contracts/__next.contracts.__PAGE__.txt +9 -0
- ui/static/static/static/contracts/__next.contracts.txt +4 -0
- ui/static/static/static/contracts/index.html +1 -0
- ui/static/static/static/contracts/index.txt +21 -0
- ui/static/static/static/documentation/__next._full.txt +21 -0
- ui/static/static/static/documentation/__next._head.txt +7 -0
- ui/static/static/static/documentation/__next._index.txt +9 -0
- ui/static/static/static/documentation/__next._tree.txt +2 -0
- ui/static/static/static/documentation/__next.documentation.__PAGE__.txt +9 -0
- ui/static/static/static/documentation/__next.documentation.txt +4 -0
- ui/static/static/static/documentation/index.html +93 -0
- ui/static/static/static/documentation/index.txt +21 -0
- ui/static/static/static/index.html +1 -0
- ui/static/static/static/index.txt +30 -0
- ui/static/static/static/metadata/__next._full.txt +21 -0
- ui/static/static/static/metadata/__next._head.txt +7 -0
- ui/static/static/static/metadata/__next._index.txt +9 -0
- ui/static/static/static/metadata/__next._tree.txt +2 -0
- ui/static/static/static/metadata/__next.metadata.__PAGE__.txt +9 -0
- ui/static/static/static/metadata/__next.metadata.txt +4 -0
- ui/static/static/static/metadata/index.html +1 -0
- ui/static/static/static/metadata/index.txt +21 -0
- ui/static/static/static/quality/__next._full.txt +21 -0
- ui/static/static/static/quality/__next._head.txt +7 -0
- ui/static/static/static/quality/__next._index.txt +9 -0
- ui/static/static/static/quality/__next._tree.txt +2 -0
- ui/static/static/static/quality/__next.quality.__PAGE__.txt +9 -0
- ui/static/static/static/quality/__next.quality.txt +4 -0
- ui/static/static/static/quality/index.html +2 -0
- ui/static/static/static/quality/index.txt +21 -0
- ui/static/static/static/rules/__next._full.txt +21 -0
- ui/static/static/static/rules/__next._head.txt +7 -0
- ui/static/static/static/rules/__next._index.txt +9 -0
- ui/static/static/static/rules/__next._tree.txt +2 -0
- ui/static/static/static/rules/__next.rules.__PAGE__.txt +9 -0
- ui/static/static/static/rules/__next.rules.txt +4 -0
- ui/static/static/static/rules/index.html +1 -0
- ui/static/static/static/rules/index.txt +21 -0
- ui/static/static/static/schemas/__next._full.txt +21 -0
- ui/static/static/static/schemas/__next._head.txt +7 -0
- ui/static/static/static/schemas/__next._index.txt +9 -0
- ui/static/static/static/schemas/__next._tree.txt +2 -0
- ui/static/static/static/schemas/__next.schemas.__PAGE__.txt +9 -0
- ui/static/static/static/schemas/__next.schemas.txt +4 -0
- ui/static/static/static/schemas/index.html +1 -0
- ui/static/static/static/schemas/index.txt +21 -0
- ui/static/static/static/settings/__next._full.txt +21 -0
- ui/static/static/static/settings/__next._head.txt +7 -0
- ui/static/static/static/settings/__next._index.txt +9 -0
- ui/static/static/static/settings/__next._tree.txt +2 -0
- ui/static/static/static/settings/__next.settings.__PAGE__.txt +9 -0
- ui/static/static/static/settings/__next.settings.txt +4 -0
- ui/static/static/static/settings/index.html +1 -0
- ui/static/static/static/settings/index.txt +21 -0
- ui/static/static/static/validation/__next._full.txt +21 -0
- ui/static/static/static/validation/__next._head.txt +7 -0
- ui/static/static/static/validation/__next._index.txt +9 -0
- ui/static/static/static/validation/__next._tree.txt +2 -0
- ui/static/static/static/validation/__next.validation.__PAGE__.txt +9 -0
- ui/static/static/static/validation/__next.validation.txt +4 -0
- ui/static/static/static/validation/index.html +1 -0
- ui/static/static/static/validation/index.txt +21 -0
- ui/static/static/validation/__next._full.txt +2 -2
- ui/static/static/validation/__next._head.txt +1 -1
- ui/static/static/validation/__next._index.txt +2 -2
- ui/static/static/validation/__next._tree.txt +2 -2
- ui/static/static/validation/__next.validation.__PAGE__.txt +1 -1
- ui/static/static/validation/__next.validation.txt +1 -1
- ui/static/static/validation/index.html +1 -1
- ui/static/static/validation/index.txt +2 -2
- ui/static/validation/__next._full.txt +2 -2
- ui/static/validation/__next._head.txt +1 -1
- ui/static/validation/__next._index.txt +1 -1
- ui/static/validation/__next._tree.txt +1 -1
- ui/static/validation/__next.validation.__PAGE__.txt +2 -2
- ui/static/validation/__next.validation.txt +1 -1
- ui/static/validation/index.html +1 -1
- ui/static/validation/index.txt +2 -2
- pycharter/data/templates/template_coercion_rules.yaml +0 -15
- pycharter/data/templates/template_contract.yaml +0 -587
- pycharter/data/templates/template_metadata.yaml +0 -38
- pycharter/data/templates/template_schema.yaml +0 -22
- pycharter/data/templates/template_transform_advanced.yaml +0 -50
- pycharter/data/templates/template_transform_simple.yaml +0 -59
- pycharter/data/templates/template_validation_rules.yaml +0 -29
- pycharter/etl_generator/extraction.py +0 -916
- pycharter/etl_generator/factory.py +0 -174
- pycharter/etl_generator/orchestrator.py +0 -1650
- pycharter/integrations/__init__.py +0 -19
- pycharter/integrations/kafka.py +0 -178
- pycharter/integrations/streaming.py +0 -100
- pycharter-0.0.22.dist-info/RECORD +0 -358
- {pycharter-0.0.22.dist-info → pycharter-0.0.24.dist-info}/entry_points.txt +0 -0
- {pycharter-0.0.22.dist-info → pycharter-0.0.24.dist-info}/licenses/LICENSE +0 -0
- {pycharter-0.0.22.dist-info → pycharter-0.0.24.dist-info}/top_level.txt +0 -0
- /ui/static/_next/static/{0rYA78L88aUyD2Uh38hhX → 2gKjNv6YvE6BcIdFthBLs}/_buildManifest.js +0 -0
- /ui/static/_next/static/{0rYA78L88aUyD2Uh38hhX → 2gKjNv6YvE6BcIdFthBLs}/_ssgManifest.js +0 -0
- /ui/static/static/_next/static/{tNTkVW6puVXC4bAm4WrHl → 0rYA78L88aUyD2Uh38hhX}/_buildManifest.js +0 -0
- /ui/static/static/_next/static/{tNTkVW6puVXC4bAm4WrHl → 0rYA78L88aUyD2Uh38hhX}/_ssgManifest.js +0 -0
- /ui/static/{_next → static/_next}/static/chunks/c4fa4f4114b7c352.js +0 -0
- /ui/static/static/{_next → static/_next}/static/chunks/4e310fe5005770a3.css +0 -0
- /ui/static/{_next → static/static/_next}/static/chunks/5e04d10c4a7b58a3.js +0 -0
- /ui/static/static/{_next → static/_next}/static/chunks/5fc14c00a2779dc5.js +0 -0
- /ui/static/{_next → static/static/_next}/static/chunks/75d88a058d8ffaa6.js +0 -0
- /ui/static/{_next → static/static/_next}/static/chunks/8c89634cf6bad76f.js +0 -0
- /ui/static/static/{_next → static/_next}/static/chunks/b584574fdc8ab13e.js +0 -0
- /ui/static/static/{_next → static/_next}/static/chunks/d5989c94d3614b3a.js +0 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ValidatorBuilder - Fluent API for constructing validators.
|
|
3
|
+
|
|
4
|
+
Provides a clean, chainable interface for creating Validator instances
|
|
5
|
+
with various configuration options.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import Any, Dict, Optional, TYPE_CHECKING
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from pycharter.contract_parser import ContractMetadata
|
|
13
|
+
from pycharter.metadata_store import MetadataStoreClient
|
|
14
|
+
from pycharter.quality.tracking import MetricsCollector
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ValidatorBuilder:
|
|
18
|
+
"""
|
|
19
|
+
Fluent builder for constructing Validator instances.
|
|
20
|
+
|
|
21
|
+
Provides a clean, chainable API for configuring validators:
|
|
22
|
+
|
|
23
|
+
Example:
|
|
24
|
+
>>> from pycharter.runtime_validator import ValidatorBuilder
|
|
25
|
+
>>>
|
|
26
|
+
>>> # From explicit files (most flexible)
|
|
27
|
+
>>> validator = (
|
|
28
|
+
... ValidatorBuilder()
|
|
29
|
+
... .from_files(schema="schema.yaml", coercion_rules="coercion.yaml")
|
|
30
|
+
... .strict()
|
|
31
|
+
... .build()
|
|
32
|
+
... )
|
|
33
|
+
>>>
|
|
34
|
+
>>> # From directory (expects schema.yaml, coercion_rules.yaml, validation_rules.yaml)
|
|
35
|
+
>>> validator = (
|
|
36
|
+
... ValidatorBuilder()
|
|
37
|
+
... .from_dir("contracts/user/")
|
|
38
|
+
... .strict()
|
|
39
|
+
... .build()
|
|
40
|
+
... )
|
|
41
|
+
>>>
|
|
42
|
+
>>> # From single file
|
|
43
|
+
>>> validator = (
|
|
44
|
+
... ValidatorBuilder()
|
|
45
|
+
... .from_file("contracts/user.yaml")
|
|
46
|
+
... .with_quality_checks()
|
|
47
|
+
... .build()
|
|
48
|
+
... )
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
def __init__(self):
|
|
52
|
+
self._contract_dir: Optional[str] = None
|
|
53
|
+
self._contract_file: Optional[str] = None
|
|
54
|
+
self._contract_dict: Optional[Dict[str, Any]] = None
|
|
55
|
+
self._contract_metadata: Optional["ContractMetadata"] = None
|
|
56
|
+
self._store: Optional["MetadataStoreClient"] = None
|
|
57
|
+
self._schema_id: Optional[str] = None
|
|
58
|
+
self._schema_version: Optional[str] = None
|
|
59
|
+
self._strict_mode: bool = False
|
|
60
|
+
self._include_quality: bool = False
|
|
61
|
+
self._quality_thresholds: Optional[Dict[str, float]] = None
|
|
62
|
+
self._metrics_collector: Optional["MetricsCollector"] = None
|
|
63
|
+
|
|
64
|
+
def from_dir(self, directory: str) -> "ValidatorBuilder":
|
|
65
|
+
"""
|
|
66
|
+
Load contract from directory.
|
|
67
|
+
|
|
68
|
+
Expects files with standard names:
|
|
69
|
+
- schema.yaml (required)
|
|
70
|
+
- coercion_rules.yaml (optional)
|
|
71
|
+
- validation_rules.yaml (optional)
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
directory: Path to contract directory
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
Self for chaining
|
|
78
|
+
"""
|
|
79
|
+
self._contract_dir = directory
|
|
80
|
+
return self
|
|
81
|
+
|
|
82
|
+
def from_file(self, path: str) -> "ValidatorBuilder":
|
|
83
|
+
"""
|
|
84
|
+
Load contract from a single file containing all sections.
|
|
85
|
+
|
|
86
|
+
Args:
|
|
87
|
+
path: Path to contract file (YAML/JSON)
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
Self for chaining
|
|
91
|
+
"""
|
|
92
|
+
self._contract_file = path
|
|
93
|
+
return self
|
|
94
|
+
|
|
95
|
+
def from_dict(self, contract_dict: Dict[str, Any]) -> "ValidatorBuilder":
|
|
96
|
+
"""
|
|
97
|
+
Load contract from dictionary.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
contract_dict: Contract dictionary with 'schema', 'coercion_rules',
|
|
101
|
+
'validation_rules' keys
|
|
102
|
+
|
|
103
|
+
Returns:
|
|
104
|
+
Self for chaining
|
|
105
|
+
"""
|
|
106
|
+
self._contract_dict = contract_dict
|
|
107
|
+
return self
|
|
108
|
+
|
|
109
|
+
def from_files(
|
|
110
|
+
self,
|
|
111
|
+
schema: str,
|
|
112
|
+
coercion_rules: Optional[str] = None,
|
|
113
|
+
validation_rules: Optional[str] = None,
|
|
114
|
+
) -> "ValidatorBuilder":
|
|
115
|
+
"""
|
|
116
|
+
Load contract from explicit file paths.
|
|
117
|
+
|
|
118
|
+
This method accepts any file paths without assuming directory structure
|
|
119
|
+
or file naming conventions. Use any file names you want.
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
schema: Path to schema file (YAML or JSON)
|
|
123
|
+
coercion_rules: Optional path to coercion rules file
|
|
124
|
+
validation_rules: Optional path to validation rules file
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
Self for chaining
|
|
128
|
+
|
|
129
|
+
Example:
|
|
130
|
+
validator = (
|
|
131
|
+
ValidatorBuilder()
|
|
132
|
+
.from_files(
|
|
133
|
+
schema="my_schema.yaml",
|
|
134
|
+
coercion_rules="my_coercions.yaml",
|
|
135
|
+
validation_rules="my_validations.yaml"
|
|
136
|
+
)
|
|
137
|
+
.strict()
|
|
138
|
+
.build()
|
|
139
|
+
)
|
|
140
|
+
"""
|
|
141
|
+
import yaml
|
|
142
|
+
|
|
143
|
+
schema_path = Path(schema)
|
|
144
|
+
if not schema_path.exists():
|
|
145
|
+
raise FileNotFoundError(f"Schema file not found: {schema_path}")
|
|
146
|
+
|
|
147
|
+
# Load schema
|
|
148
|
+
with open(schema_path) as f:
|
|
149
|
+
schema_data = yaml.safe_load(f)
|
|
150
|
+
|
|
151
|
+
# Load coercion rules if provided
|
|
152
|
+
coercion_data = {}
|
|
153
|
+
if coercion_rules:
|
|
154
|
+
coercion_path = Path(coercion_rules)
|
|
155
|
+
if coercion_path.exists():
|
|
156
|
+
with open(coercion_path) as f:
|
|
157
|
+
coercion_data = yaml.safe_load(f) or {}
|
|
158
|
+
|
|
159
|
+
# Load validation rules if provided
|
|
160
|
+
validation_data = {}
|
|
161
|
+
if validation_rules:
|
|
162
|
+
validation_path = Path(validation_rules)
|
|
163
|
+
if validation_path.exists():
|
|
164
|
+
with open(validation_path) as f:
|
|
165
|
+
validation_data = yaml.safe_load(f) or {}
|
|
166
|
+
|
|
167
|
+
self._contract_dict = {
|
|
168
|
+
"schema": schema_data,
|
|
169
|
+
"coercion_rules": coercion_data,
|
|
170
|
+
"validation_rules": validation_data,
|
|
171
|
+
}
|
|
172
|
+
return self
|
|
173
|
+
|
|
174
|
+
def from_metadata(self, contract_metadata: "ContractMetadata") -> "ValidatorBuilder":
|
|
175
|
+
"""
|
|
176
|
+
Load contract from ContractMetadata object.
|
|
177
|
+
|
|
178
|
+
Args:
|
|
179
|
+
contract_metadata: ContractMetadata object from parse_contract
|
|
180
|
+
|
|
181
|
+
Returns:
|
|
182
|
+
Self for chaining
|
|
183
|
+
"""
|
|
184
|
+
self._contract_metadata = contract_metadata
|
|
185
|
+
return self
|
|
186
|
+
|
|
187
|
+
def from_store(
|
|
188
|
+
self,
|
|
189
|
+
store: "MetadataStoreClient",
|
|
190
|
+
schema_id: str,
|
|
191
|
+
version: Optional[str] = None,
|
|
192
|
+
) -> "ValidatorBuilder":
|
|
193
|
+
"""
|
|
194
|
+
Load contract from metadata store.
|
|
195
|
+
|
|
196
|
+
Args:
|
|
197
|
+
store: MetadataStoreClient instance
|
|
198
|
+
schema_id: Schema identifier
|
|
199
|
+
version: Optional schema version (defaults to latest)
|
|
200
|
+
|
|
201
|
+
Returns:
|
|
202
|
+
Self for chaining
|
|
203
|
+
"""
|
|
204
|
+
self._store = store
|
|
205
|
+
self._schema_id = schema_id
|
|
206
|
+
self._schema_version = version
|
|
207
|
+
return self
|
|
208
|
+
|
|
209
|
+
def strict(self) -> "ValidatorBuilder":
|
|
210
|
+
"""
|
|
211
|
+
Enable strict mode.
|
|
212
|
+
|
|
213
|
+
In strict mode, validation errors will raise exceptions
|
|
214
|
+
instead of returning ValidationResult with is_valid=False.
|
|
215
|
+
|
|
216
|
+
Returns:
|
|
217
|
+
Self for chaining
|
|
218
|
+
"""
|
|
219
|
+
self._strict_mode = True
|
|
220
|
+
return self
|
|
221
|
+
|
|
222
|
+
def lenient(self) -> "ValidatorBuilder":
|
|
223
|
+
"""
|
|
224
|
+
Enable lenient mode (default).
|
|
225
|
+
|
|
226
|
+
In lenient mode, validation errors are captured in
|
|
227
|
+
ValidationResult.errors without raising exceptions.
|
|
228
|
+
|
|
229
|
+
Returns:
|
|
230
|
+
Self for chaining
|
|
231
|
+
"""
|
|
232
|
+
self._strict_mode = False
|
|
233
|
+
return self
|
|
234
|
+
|
|
235
|
+
def with_quality_checks(
|
|
236
|
+
self,
|
|
237
|
+
thresholds: Optional[Dict[str, float]] = None,
|
|
238
|
+
) -> "ValidatorBuilder":
|
|
239
|
+
"""
|
|
240
|
+
Enable quality checks during validation.
|
|
241
|
+
|
|
242
|
+
When enabled, validation results will include quality metrics
|
|
243
|
+
like completeness, accuracy, and uniqueness scores.
|
|
244
|
+
|
|
245
|
+
Args:
|
|
246
|
+
thresholds: Optional quality thresholds for pass/fail
|
|
247
|
+
e.g., {"completeness": 0.95, "accuracy": 0.99}
|
|
248
|
+
|
|
249
|
+
Returns:
|
|
250
|
+
Self for chaining
|
|
251
|
+
"""
|
|
252
|
+
self._include_quality = True
|
|
253
|
+
self._quality_thresholds = thresholds
|
|
254
|
+
return self
|
|
255
|
+
|
|
256
|
+
def with_tracking(self, collector: "MetricsCollector") -> "ValidatorBuilder":
|
|
257
|
+
"""
|
|
258
|
+
Enable metrics tracking for validation runs.
|
|
259
|
+
|
|
260
|
+
When enabled, validation metrics are automatically recorded
|
|
261
|
+
to the provided MetricsCollector for time-series analysis.
|
|
262
|
+
|
|
263
|
+
Args:
|
|
264
|
+
collector: MetricsCollector instance for recording metrics
|
|
265
|
+
|
|
266
|
+
Returns:
|
|
267
|
+
Self for chaining
|
|
268
|
+
|
|
269
|
+
Example:
|
|
270
|
+
>>> from pycharter.quality.tracking import MetricsCollector, InMemoryMetricsStore
|
|
271
|
+
>>>
|
|
272
|
+
>>> store = InMemoryMetricsStore()
|
|
273
|
+
>>> collector = MetricsCollector(store)
|
|
274
|
+
>>>
|
|
275
|
+
>>> validator = (
|
|
276
|
+
... ValidatorBuilder()
|
|
277
|
+
... .from_directory("contracts/user")
|
|
278
|
+
... .with_tracking(collector)
|
|
279
|
+
... .build()
|
|
280
|
+
... )
|
|
281
|
+
>>>
|
|
282
|
+
>>> # Validation metrics are automatically recorded
|
|
283
|
+
>>> result = validator.validate(data)
|
|
284
|
+
>>>
|
|
285
|
+
>>> # Query recorded metrics
|
|
286
|
+
>>> metrics = collector.query(schema_name="user")
|
|
287
|
+
"""
|
|
288
|
+
self._metrics_collector = collector
|
|
289
|
+
return self
|
|
290
|
+
|
|
291
|
+
def build(self) -> "Validator":
|
|
292
|
+
"""
|
|
293
|
+
Build the Validator instance.
|
|
294
|
+
|
|
295
|
+
Returns:
|
|
296
|
+
Configured Validator instance
|
|
297
|
+
|
|
298
|
+
Raises:
|
|
299
|
+
ValueError: If no contract source is specified
|
|
300
|
+
"""
|
|
301
|
+
from pycharter.runtime_validator.validator import Validator
|
|
302
|
+
|
|
303
|
+
# Create base validator
|
|
304
|
+
validator = Validator(
|
|
305
|
+
contract_dir=self._contract_dir,
|
|
306
|
+
contract_file=self._contract_file,
|
|
307
|
+
contract_dict=self._contract_dict,
|
|
308
|
+
contract_metadata=self._contract_metadata,
|
|
309
|
+
store=self._store,
|
|
310
|
+
schema_id=self._schema_id,
|
|
311
|
+
schema_version=self._schema_version,
|
|
312
|
+
)
|
|
313
|
+
|
|
314
|
+
# Apply configuration
|
|
315
|
+
validator._strict_mode = self._strict_mode
|
|
316
|
+
validator._include_quality = self._include_quality
|
|
317
|
+
validator._quality_thresholds = self._quality_thresholds
|
|
318
|
+
validator._metrics_collector = self._metrics_collector
|
|
319
|
+
|
|
320
|
+
return validator
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
class Validator:
|
|
324
|
+
"""Extended Validator with builder configuration support."""
|
|
325
|
+
|
|
326
|
+
# This is a forward reference - actual implementation is in validator.py
|
|
327
|
+
# The builder will use the real Validator class
|
|
328
|
+
pass
|