Skip to main content

A CLI for reproducible data cleaning pipelines.

Project description

DataForge CLI

Python Version PyPI Version Build Status

DataForge is a local-first, Python-based CLI for building and running reproducible data-cleaning pipelines.

The Problem

Cleaning data inside sprawling Jupyter notebooks or ad-hoc Excel sheets is repetitive, fragile, and easy to break. Each dataset requires copy/pasting logic, manual tweaks, and constant vigilance to avoid regressions.

The Solution

DataForge captures every cleaning step as an ordered, versionable pipeline stored in MySQL. Once your recipe is defined, you can rerun it on fresh data instantly—no notebooks to maintain, no spreadsheets to reconcile.

Core Features

  • dataforge profile: Instantly profile a CSV to inspect null counts, column types, medians, and more.
  • dataforge pipeline: Create pipelines, append ordered steps, inspect them, rename, or delete outdated flows.
  • dataforge run: Execute an entire pipeline in batch mode to transform messy CSVs into clean outputs.
  • dataforge run --interactive: Step through each operation with Undo support for safe experimentation.

Tech Stack

Python · Click · Pandas · NumPy · MySQL · scikit-learn

Installation & Setup

  1. Clone the repository
    git clone https://github.com/bit2swaz/dataforge-python.git
    cd dataforge-python
    
  2. Create a virtual environment
    python -m venv venv
    source venv/bin/activate
    
  3. Install dependencies
    pip install -r requirements.txt
    
  4. Configure environment variables
    cp .env.example .env
    # Update credentials if necessary
    
  5. Prepare MySQL
    CREATE DATABASE IF NOT EXISTS dataforge;
    CREATE USER 'dataforge_user'@'localhost' IDENTIFIED BY 'your_password';
    GRANT ALL PRIVILEGES ON dataforge.* TO 'dataforge_user'@'localhost';
    FLUSH PRIVILEGES;
    
  6. Create the schema
    python db_init.py
    
  7. Install DataForge in editable mode
    pip install -e .
    

Quick Start (Usage)

# 1. Profile your data
dataforge profile messy_data.csv

# 2. Create a pipeline
dataforge pipeline create "my-first-cleaner"

# 3. Add cleaning steps
dataforge pipeline add "my-first-cleaner" --op "regex_replace" --params '{"column": "product_name", "pattern": "SKU-", "replace": ""}' --order 1
dataforge pipeline add "my-first-cleaner" --op "drop_nulls" --params '{"column": "email"}' --order 2

# 4. Run the pipeline!
dataforge run "my-first-cleaner" -i "messy_data.csv" -o "clean_output.csv"

Available Transformers

  • op_regex_replace
  • op_drop_nulls
  • op_fill_nulls
  • op_rename_column
  • op_drop_column
  • op_change_type
  • op_scale_minmax
  • op_one_hot_encode

Running Tests

pytest

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

dataforge_cli-0.1.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

dataforge_cli-0.1.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file dataforge_cli-0.1.1.tar.gz.

File metadata

  • Download URL: dataforge_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dataforge_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 75bda7dc1a6956120c00d40b181d2046684f43bb755168207f8e97c067a045eb
MD5 2935dace57f6f2e6e781086e701d8104
BLAKE2b-256 124ea527868d620dc62b893f2cd02c4309768927b9d1cf9c1c9dc907c6c2be9d

See more details on using hashes here.

File details

Details for the file dataforge_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dataforge_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dataforge_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 22e2a34eba89e139b25f694e014f2ade0a28374e672cc759285a5f0283ae4170
MD5 a13c6e6cd602a97f56365d9bd9574590
BLAKE2b-256 9b56394296b8db70ebec4f7e14f35e66f41733589f09283b546d4251391c9ebd

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