Skip to main content

Engineering-First ML Library for building robust, production-grade machine learning pipelines

Project description

ForgeFlow

PyPI version Python 3.10+ License: MIT CI

Production-grade ML library for building reliable, type-safe machine learning pipelines.

ForgeFlow is designed for engineering teams who need robust data validation, reproducible feature engineering, and production-ready ML infrastructure. Built with strict type safety, immutability, and defensive programming principles.

Why ForgeFlow?

Modern ML systems fail in production due to data quality issues, schema drift, and unreliable pipelines. ForgeFlow addresses these challenges with:

  • Strict Schema Validation - Pydantic-based contracts that fail fast on invalid data
  • Immutable Operations - Pure functions that prevent side effects and ensure reproducibility
  • Quality Gates - Automated checks that prevent bad data from reaching production
  • Drift Detection - Statistical monitoring to catch distribution shifts early
  • Type Safety - 100% type-hinted codebase for better IDE support and fewer runtime errors

Installation

pip install forge-flow

Optional dependencies:

pip install forge-flow[serving]    # Redis-based feature store
pip install forge-flow[database]   # SQL database connectors
pip install forge-flow[all]        # Everything

Quick Start

ForgeFlow follows a simple pipeline pattern: Ingest → Validate → Transform → Serve

1. Define Your Schema

Schemas enforce data contracts and catch issues early:

from forge_flow.schemas import StrictSchema
from pydantic import Field

class Transaction(StrictSchema):
    user_id: int = Field(gt=0)
    amount: float = Field(gt=0, le=1000000)
    timestamp: datetime

2. Validate Data

Automatic validation with Dead Letter Queue for invalid records:

from forge_flow.schemas import SchemaValidator

validator = SchemaValidator(Transaction)
clean_data = validator.validate(raw_data, raise_on_error=False)

3. Engineer Features

Immutable transformations with built-in quality checks:

from forge_flow.features import DataCleaner, FeatureEngineer

cleaner = DataCleaner()
cleaned = cleaner.handle_nulls(clean_data)

engineer = FeatureEngineer()
features = engineer.add_rolling_features(
    cleaned,
    group_col='user_id',
    value_col='amount',
    windows=[7, 30]
)

4. Quality Gates

Prevent bad data from reaching production:

from forge_flow.features import QualityGate

gate = QualityGate(max_null_rate=0.05, min_rows=1000)
gate.validate(features)  # Raises error if quality fails

Core Features

Data Ingestion

  • File Connectors - Read from local, S3, GCS, Azure (Parquet, CSV, JSON)
  • API Connectors - Resilient HTTP clients with retries and rate limiting
  • Database Connectors - SQLAlchemy-based with incremental loading

Feature Engineering

  • Data Cleaning - Null handling, outlier detection, type casting
  • Transformations - Rolling windows, lag features, encoding, normalization
  • Pipelines - Reproducible workflows with Pydantic configuration

Production Features

  • Online Store - Redis-based sub-millisecond feature serving
  • Drift Detection - KS test for numeric, PSI for categorical features
  • Structured Logging - Full observability with structlog

Design Principles

ForgeFlow is built for production systems, not notebooks:

  1. Fail Fast - Validate early, catch errors at ingestion boundaries
  2. Immutability - Operations return new objects, preventing side effects
  3. Type Safety - Comprehensive type hints for better tooling and fewer bugs
  4. Explicit Over Implicit - No magic, clear data flows
  5. Testability - Pure functions and dependency injection throughout

Documentation

  • Examples - Practical usage patterns and integration guides
  • Contributing - Development workflow and standards

Use Cases

ForgeFlow excels at:

  • Fraud Detection - Real-time feature serving with drift monitoring
  • Recommendation Systems - Reproducible feature pipelines at scale
  • Credit Risk - Audit trails and regulatory compliance
  • Predictive Maintenance - Time-series feature engineering

Requirements

  • Python 3.10+
  • Core: pandas, numpy, pydantic, structlog
  • Optional: redis (serving), sqlalchemy (database)

License

MIT License - see LICENSE for details.

Support


Built with ❤️ for production ML teams who value reliability over convenience.

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

forge_flow-0.1.0.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

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

forge_flow-0.1.0-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file forge_flow-0.1.0.tar.gz.

File metadata

  • Download URL: forge_flow-0.1.0.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for forge_flow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d914f35651c9a7364687a5fdcf22fb693dfb68557c0b69e8980e1c6d60334ee9
MD5 4722ebf802f08d67fbf8d004664b6951
BLAKE2b-256 5ff849f0cc58753f5395e608a1b50032de72cfa19c3825b7dfeae0bbeb3e69d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for forge_flow-0.1.0.tar.gz:

Publisher: publish.yml on danyalaltaff11555/forge-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file forge_flow-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: forge_flow-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for forge_flow-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 932055791d5d3f967b5f1d60cba45c12e5bf98e66ede6603b697d57f454aeda0
MD5 bfcdb6c14388eb4998c04933fa51a349
BLAKE2b-256 bbf813ddb1b2673d69f8ae79283d06776f6aee9afeeb31bcade9e41afba1d764

See more details on using hashes here.

Provenance

The following attestation bundles were made for forge_flow-0.1.0-py3-none-any.whl:

Publisher: publish.yml on danyalaltaff11555/forge-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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