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.0.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.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dataforge_cli-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 833147f916d33070016357f7bf8418cd508aced02cfa882b3da42dc0284537cf
MD5 847685b986aac846c6a0fb12584e2c8f
BLAKE2b-256 7acea34c3d410fad54f67122fec2b623d5545b45b7aaaef668c5fdefc435fdc5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dataforge_cli-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 991e92a2678a34d11c8bdd32ac90a50966792d6d811dc8baba2af9adc9923d85
MD5 2e3715db4a82b062efec7de412c7ea77
BLAKE2b-256 6c37b02003acae03ffdb8ecf4fa1dcd4b193e3c349455342f30b5aa04f8e7fba

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