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
Metadata
Release files for pyjeb 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyjeb-1.3.0.tar.gz | 16.8 kB | Without provenance | Details for pyjeb-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyjeb-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for pyjeb-1.3.0-py3-none-any.whl |
Total release size: 29.0 kB
Release files / pyjeb-1.3.0.tar.gz
| Download URL | pyjeb-1.3.0.tar.gz |
|---|---|
| Size | 16.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
484ef2271085c61fc4ebc7ddef6ac748ea78cbdf9632973fd6dcf5cffcd901e9
|
|
BLAKE2b-256 checksum How to use checksums |
66cca2bcde2940af1c4346f0d7af5495ce4c6563c1f303051ae2f380d2ac3876
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / pyjeb-1.3.0-py3-none-any.whl
| Download URL | pyjeb-1.3.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02a60f2ff74496d01b57a1f2ea201971571e907f47c2091a0c1c7683bb12536a
|
|
BLAKE2b-256 checksum How to use checksums |
e5ed98fad90ed1b2b9513294cde3859a2f77587c48cfbc5414c7df84247afaf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Security for pyjeb 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.