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.

``

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.1.2.tar.gz (9.3 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.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dataforge_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 9.3 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.2.tar.gz
Algorithm Hash digest
SHA256 a14b4a3babc568a10b6b54473d68467fc8ca92ae409a2685f831d6a16cbbe604
MD5 9330ef71596ebaf01313f8e9115a0633
BLAKE2b-256 264303c7ec129486b168df00fe20a8f609ba27299152208508e539383925aff6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dataforge_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 48ee4acb4f025e50487e7a90434247bcd2190a55ff01e6e81db515a85228a13d
MD5 a4242713b3f2323d7aedec1cf8029c0d
BLAKE2b-256 ad6547b0e02fdd6d51bf771a03ab2546b21bf4292189f8f204f65b4a750cf67e

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