Skip to main content

Framework for modeling, orchestrating,and executing ETL pipelines in a controlled environment.

Project description

Fragua

Fragua is a lightweight Python framework designed to design, validate, and reason about ETL logic in a fully controlled, in-memory environment.

It provides a minimal and explicit execution model where ETL functions are registered, composed, executed sequentially, and inspected — without schedulers, persistence layers, or external infrastructure.

Fragua is intentionally simple. Its goal is clarity over completeness.


Purpose

Fragua exists to answer a small, focused set of questions:

Does this ETL function behave as expected?
Does this sequence of ETL steps produce the correct result?

It is not a workflow orchestrator nor a production-grade ETL engine.
Fragua is a developer-oriented framework for modeling, validating, and experimenting with ETL logic during development.


Core Model

Fragua is built around a small set of orthogonal, loosely coupled components.

1. FraguaSet

A FraguaSet is a logical namespace for functions.

  • Stores named callables
  • Groups functions by purpose (e.g. extract, transform, load, utility)
  • Contains no execution logic
  • Has no knowledge of pipelines or data

Sets are created explicitly and only when needed.


2. FraguaRegistry

The registry is a lookup and organization layer.

  • Holds multiple FraguaSet instances
  • Resolves functions by (set_name, function_name)
  • Does not execute anything

The registry enables flexible function categorization without hardcoded assumptions.


3. FraguaStep

A FraguaStep represents a single declarative execution unit.

  • References a function by name (resolved at runtime)
  • Declares execution parameters
  • Optionally consumes the output of a previous step
  • Stores its result under a logical key (save_as)

A step defines what should happen, not how it happens.


3.1 FraguaStepBuilder

A FraguaStepBuilder is a mutable builder for constructing immutable FraguaStep objects.

  • Provides a fluent interface for step configuration
  • Allows method chaining (.with_params(), .with_save_as(), .with_use())
  • Produces immutable steps via .build()
  • Enables safe, incremental step construction

The builder reduces boilerplate while preserving step immutability.


3.2 FraguaStepIndex

A FraguaStepIndex is a template registry for preconfigured step builders.

  • Stores FraguaStepBuilder templates by name
  • Returns fresh builder copies from templates
  • Enables discoverable step composition
  • Provides safe access to registered step patterns

The index facilitates reusable step templates without sacrificing explicitness.


4. FraguaPipeline

A pipeline is an ordered execution plan.

  • Defines a sequence of FraguaStep
  • Preserves execution order
  • Contains no execution logic

Pipelines are pure definitions executed by an agent at runtime.


5. FraguaAgent

The agent is a stateless execution primitive.

  • Receives a pipeline
  • Resolves step functions via the registry
  • Executes steps sequentially
  • Produces execution results

The agent contains no domain logic and holds no state between runs.


6. FraguaWarehouse

The warehouse is an in-memory result store.

  • Stores outputs of all executed steps
  • Indexed by save_as
  • Intended for inspection, debugging, and assertions

The warehouse exists purely at runtime.


7. FraguaEnvironment

The environment is the composition and orchestration boundary.

It owns:

  • One registry
  • One agent
  • One warehouse

It provides APIs to:

  • Create and manage function sets
  • Register functions and pipelines
  • Execute pipelines
  • Retrieve execution results

The environment does not impose structure — it enables it.


Helper Abstractions

Fragua includes optional helpers to reduce boilerplate while preserving explicitness.

Composite Transform Functions

transform_fn_schema allows composing multiple transformation functions into a reusable unit:

basic_transformation = fg.transform_fn_schema(
    name="basic_transformation",
    steps=[
        ("standardize", None),
        ("add_derived_columns", None),
    ],
    registry=env.registry,
    set_name="transform",
)

This enables declarative and reusable transformation logic without hidden execution.


Automatic Step Generation

generate_steps_sequence generates pipeline steps from function declarations:

steps = fg.generate_steps_sequence(
    ("extract_excel", {"path": "input.xlsx"}),
    ("basic_transformation", {}),
    ("load_to_csv", {"path": "output.csv"}),
    set_name="extract",
)

Step generation remains explicit and deterministic.


Result Inspection

Helpers such as get_box_dfs_heads allow validated inspection of runtime results:

heads = fg.get_box_dfs_heads(box_result, pipeline.steps())

Errors are raised if expected outputs are missing or invalid.


Typical Workflow

  1. Create an environment
  2. Create one or more function sets
  3. Register ETL functions into sets
  4. Optionally compose transformations
  5. Define a pipeline
  6. Execute the pipeline
  7. Inspect results from the warehouse

Design Principles

Fragua adheres to the following principles:

  • Minimalism — no feature without a clear purpose
  • Explicitness — no hidden behavior
  • Single Responsibility — each component does one thing
  • Runtime-only — no persistence, no side effects

What Fragua Is Not

Fragua is not:

  • A scheduler
  • A workflow orchestrator
  • A production ETL engine
  • A data platform

It is a developer framework for ETL design and validation.


License

MIT License

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

fragua-1.4.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

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

fragua-1.4-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file fragua-1.4.tar.gz.

File metadata

  • Download URL: fragua-1.4.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for fragua-1.4.tar.gz
Algorithm Hash digest
SHA256 7c5bce52bbd6e2aa512cb9d4a997ec13760796e5604bb51c15b098c59c65c866
MD5 306db2eb3e9b241cfb05c11b2d718d4a
BLAKE2b-256 be14436a1846998ce23caa9e6db19d28b492225108135dcd1839532618b78bf9

See more details on using hashes here.

File details

Details for the file fragua-1.4-py3-none-any.whl.

File metadata

  • Download URL: fragua-1.4-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for fragua-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ba649d7df67955eadbe1a0e377afa1c0849064250d9afd6b68a0d6d3a8efcd0a
MD5 a195bb3066f6506a544e1ccb6a082d6f
BLAKE2b-256 3923d7665dbbe57ad13a5f3dad047a5481dbd3c044e9ff16913b5293d365cc70

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