Skip to main content

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)

Source distribution for pyjeb 1.3.0
File Size Uploaded
pyjeb-1.3.0.tar.gz 16.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyjeb 1.3.0
File Interpreter ABI Platform
pyjeb-1.3.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.1

2 release files

0.2.1

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page