Skip to main content

A CLI for reproducible data cleaning pipelines.

Project description

DataForge CLI

PyPI Python Version

DataForge is a local-first, Python-based CLI for building and running reproducible data-cleaning pipelines. Think of it as a "recipe book" for messy data.

asciicast

The Problem

The status quo for data cleaning is a maze of ever-growing Jupyter notebooks and manual Excel workbooks. Each refresh of a dataset means re-running cells in the right order, copying formulas, and hoping nothing breaks. The repetition is draining, and the chance of subtle mistakes is ever present.

The Solution

DataForge turns ad-hoc scripts into durable, versioned pipelines stored in MySQL. Capture each transformation step once, then rerun that exact recipe on demand—no notebook spelunking required and no manual tweaks lost to history.

Installation (The Easy Way)

DataForge is published on PyPI and works great with pipx.

sudo apt install pipx
pipx ensurepath
pipx install dataforge-cli

First-Time Setup (Database)

  1. Provision MySQL access
    sudo mysql
    
    CREATE USER 'dataforge_user'@'localhost' IDENTIFIED BY 'your_password_here';
    GRANT ALL PRIVILEGES ON dataforge.* TO 'dataforge_user'@'localhost';
    FLUSH PRIVILEGES;
    
  2. Run the interactive setup wizard (creates ~/.dataforge.env and initializes the schema):
    dataforge init
    
    You can re-run dataforge init at any time to update credentials, or use dataforge db init if you only need to recreate the tables.

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"

Commands & Features

  • dataforge profile <filepath> – Generate a full CSV profile showing null counts, column types, and descriptive statistics.
  • dataforge init – Guided wizard that writes ~/.dataforge.env and provisions the schema.
  • dataforge pipeline … – Manage cleaning recipes: create, add, show, rename, and delete steps stored in MySQL.
  • dataforge run … – Execute an entire pipeline in batch mode to produce a clean dataset.
  • dataforge run … --interactive – Walk through the pipeline step-by-step with a built-in Undo stack for experimentation.

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

Development & Running Tests

git clone https://github.com/bit2swaz/dataforge-python.git
cd dataforge-python
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
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.2.1.tar.gz (9.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.2.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dataforge_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 9.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.2.1.tar.gz
Algorithm Hash digest
SHA256 e240f1eb67ca5aa976b48b157265c94a55bd25f047029a34d7337b912d2aebb6
MD5 8af41424e9e44ccc8d4a55bd2430f9a6
BLAKE2b-256 db5ff8ccc593e8570d2d93d782366d2f8d412a27fa90a3872a79b2cdedb27789

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dataforge_cli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a35f33e2a8a261b7fb37a15d3383a613c688d2dd4da30d0acecd8fdc09879d5
MD5 1ba7846a7e91e3266c68af9f2e633ce4
BLAKE2b-256 3d9472778aa014717ded44e5435653b817d9da60198aa0e4c78fb11fe1d577d1

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