A powerfull lightweight library to check and variabilize your configuration files
Project description
PyJeb
PyJeb is a lightweight Python library to validate and variabilize your configuration files.
- Validate configuration structure: required fields, types, format, allowed values
- Set default values for optional fields
- Inject dynamic values: system variables, user variables, custom functions
- Case-insensitive parameter matching
- Expose configuration as an attribute-accessible Python object
Installation
pip install pyjeb
Quick example
job.yaml
ingest_customers:
source:
path: "/landing/$var.env/customers/$sys.timestamp('YYYY-MM-DD')"
format: "csv"
target:
path: "/bronze/$var.env/customers"
ingest_orders:
source:
path: "/landing/$var.env/orders/$sys.timestamp('YYYY-MM-DD')"
format: "json"
target:
path: "/bronze/$var.env/orders"
import yaml
from pyjeb import control_and_setup
with open("job.yaml") as f:
config = yaml.safe_load(f)
controls = [
{ "name": "source", "type": "dict" },
{ "name": "source.path" },
{ "name": "source.format", "validset": ["csv", "json", "parquet"] },
{ "name": "source.pattern", "default": "*" },
{ "name": "target", "type": "dict" },
{ "name": "target.path" },
{ "name": "target.mode", "default": "append", "validset": ["append", "overwrite"] },
{ "name": "enabled", "type": "boolean", "default": True },
{ "name": "max_retries", "type": "integer", "default": 3 },
]
variables = { "env": "prod" }
for job_name, job_config in config.items():
job = control_and_setup(job_config, controls, variables=variables, to_object=True)
print(f"{job_name}: {job.source.path} → {job.target.path}")
Output (run on 2026-05-11):
ingest_customers: /landing/prod/customers/2026-05-11 → /bronze/prod/customers
ingest_orders: /landing/prod/orders/2026-05-11 → /bronze/prod/orders
Documentation
Full documentation is available on the GitHub wiki.
Output of the script
--------------- HR - Employees
source.path = '/Landing/HR/Employees/2023-12-14'
source.pattern = '*.csv'
target.path = '/Bronze/HR/Employees'
--------------- HR - Managers
source.path = '/Landing/HR/Managers/2023-12-14'
source.pattern = '*'
target.path = '/Bronze/HR/Managers'
--------------- HR - Payroll
source.path = '/Landing/HR/Payroll/2023-12-14'
source.pattern = '*'
target.path = '/Bronze/HR/Payroll'
control_and_setup function
The function control_and_setup is the only one to use in PyJeb. It use to apply controls and setup default and variables values.
See all about the structure in control_and_setup
Configuration
The configuration is a dictionary of dictionaries. Each key is a section and each section is a dictionary of key-value pairs.
Exemple:
HR - Employees:
source:
path: "/Landing/HR/Employees/$sys.timestamp('YYYY-MM-DD')"
pattern: "*.csv"
target:
path: "/Bronze/HR/Employees"
HR - Managers:
source:
path: "/Landing/HR/Managers/$sys.timestamp('YYYY-MM-DD')"
target:
path: "/Bronze/HR/Managers"
HR - Payroll:
source:
path: "/Landing/HR/Payroll/$sys.timestamp('YYYY-MM-DD')"
target:
path: "/Bronze/HR/Payroll"
Controls
The controls are a list of dictionaries. Each dictionary is a control to apply on the configuration.
See all about the structure in controls page
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 pyjeb-1.3.0.tar.gz.
File metadata
- Download URL: pyjeb-1.3.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
484ef2271085c61fc4ebc7ddef6ac748ea78cbdf9632973fd6dcf5cffcd901e9
|
|
| MD5 |
c6c332543f9e87059d3aa01b3cc943ea
|
|
| BLAKE2b-256 |
66cca2bcde2940af1c4346f0d7af5495ce4c6563c1f303051ae2f380d2ac3876
|
File details
Details for the file pyjeb-1.3.0-py3-none-any.whl.
File metadata
- Download URL: pyjeb-1.3.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02a60f2ff74496d01b57a1f2ea201971571e907f47c2091a0c1c7683bb12536a
|
|
| MD5 |
c65e349bb0f70951e8bce586845b4d6c
|
|
| BLAKE2b-256 |
e5ed98fad90ed1b2b9513294cde3859a2f77587c48cfbc5414c7df84247afaf7
|