wrang
Lightning-fast data wrangling for the terminal.
wrang is a terminal-native data analysis toolkit. Load, inspect, clean, transform, and export datasets without writing a single line of boilerplate. Use it interactively, script it as a Python library, or wire it into CI pipelines.
Install
pip install wrang
Optional extras:
pip install wrang[viz] # matplotlib + seaborn
pip install wrang[advanced] # duckdb + connectorx
pip install wrang[full] # everything
Requires Python 3.10+.
Migrating from
ride-cli? Bothwrangandridecommands are installed — they are identical aliases. Your existingride ...scripts will continue to work unchanged.
Quick start
# Interactive mode
wrang
# Load a file directly
wrang data.csv
# Quick inspect (CI-friendly JSON output)
wrang data.csv --inspect --output-format json
# SQL query via DuckDB
wrang data.csv --sql "SELECT dept, AVG(salary) FROM data GROUP BY dept"
# Generate self-contained HTML profile report
wrang data.csv --profile
# Compare two datasets
wrang --compare before.csv after.csv
# Stream large files in chunks
wrang large.csv --chunk-size 50000
# Export to Parquet
wrang data.csv --export clean.parquet
Interactive menu
wrang
The full interactive session gives you a menu-driven workflow:
| Option | Action |
|---|---|
1 |
Load dataset (CSV / Excel / Parquet / JSON) |
2 |
Inspect — shape, types, missing values, quality report |
3 |
Explore — correlations, distributions, outliers, plots |
4 |
Clean — impute, deduplicate, handle outliers, fix types |
5 |
Transform — encode, scale, polynomial features, binning |
6 |
Visualize — terminal histograms, scatter, heatmap |
7 |
Export — save to any supported format |
8 |
Settings — configure wrang preferences |
9 |
SQL Query — run DuckDB SQL against the current dataset |
10 |
HTML Profile — generate a full standalone HTML report |
11 |
Validate — check data against a JSON/YAML schema |
$ |
Quick export — save current dataset instantly |
q |
Exit |
Python API
wrang is also a full Python library. Every module is independently importable.
Load & save
from wrang import FastDataLoader, DataSaver
loader = FastDataLoader()
df = loader.load("sales.csv") # auto-detects format
df_lazy = loader.scan_lazy("big.parquet") # lazy frame for large files
saver = DataSaver()
saver.save(df, "output.parquet")
Inspect
from wrang import DataInspector
inspector = DataInspector(df)
info = inspector.get_basic_info()
print(info["n_rows"], info["missing_values_total"])
inspector.display_overview() # rich terminal output
inspector.display_data_quality()
Explore
from wrang import DataExplorer
explorer = DataExplorer(df)
corr = explorer.analyze_correlations(method="pearson")
outliers = explorer.detect_outliers(method="iqr")
normality = explorer.test_normality()
explorer.plot_histogram("age")
explorer.plot_scatter("age", "salary")
explorer.plot_correlation_heatmap()
Clean
from wrang import DataCleaner
from wrang.config import ImputationStrategy
cleaned = (
DataCleaner(df)
.handle_missing_values(ImputationStrategy.MEDIAN, columns=["age", "salary"])
.handle_missing_values(ImputationStrategy.MODE, columns=["dept"])
.remove_duplicates()
.handle_outliers(method="iqr", action="remove")
.get_cleaned_data()
)
Supported imputation strategies: DROP, MEAN, MEDIAN, MODE, FORWARD_FILL, BACKWARD_FILL, CUSTOM_VALUE, DISTRIBUTION, KNN.
Transform
from wrang import DataTransformer, create_pipeline
from wrang.config import EncodingMethod, ScalingMethod
result = (
DataTransformer(df)
.encode_categorical_features(method=EncodingMethod.ONEHOT, columns=["dept"])
.scale_features(method=ScalingMethod.STANDARD, columns=["age", "salary"])
.get_transformed_data()
)
# Or use the pipeline builder
result = (
create_pipeline(df)
.encode_categorical_features(method=EncodingMethod.LABEL)
.scale_features(method=ScalingMethod.ROBUST)
.create_polynomial_features(degree=2)
.get_transformed_data()
)
Validate
from wrang import DataSchema, ColumnSchema, DataValidator
schema = DataSchema(columns=[
ColumnSchema(name="id", dtype="Int64", nullable=False, unique=True),
ColumnSchema(name="salary", dtype="Float64", nullable=False, min_value=0.0),
ColumnSchema(name="dept", dtype="String", allowed_values=["eng", "hr"]),
])
result = DataValidator(schema).validate(df)
print(result.passed) # True / False
for v in result.violations:
print(v.severity, v.message)
# Infer schema from data and save to file
from wrang import infer_schema
infer_schema(df).to_json("schema.json")
Configuration
from wrang.config import get_config, update_config, reset_config
config = get_config()
print(config.outlier_factor) # 1.5
update_config(outlier_factor=2.0, chunk_size=5000)
reset_config()
User config is persisted at ~/.wrang/config.json.
Notebook usage
import polars as pl
from wrang import DataInspector, DataCleaner, DataExplorer
from wrang.config import ImputationStrategy
df = pl.read_csv("titanic.csv")
# Profile the data
DataInspector(df).display_overview()
# Clean
df_clean = (
DataCleaner(df)
.handle_missing_values(ImputationStrategy.MEDIAN)
.remove_duplicates()
.get_cleaned_data()
)
# Explore
explorer = DataExplorer(df_clean.select(["Age", "Fare", "Pclass"]))
explorer.plot_histogram("Age")
explorer.plot_scatter("Age", "Fare")
Supported file formats
| Format | Read | Write | Notes |
|---|---|---|---|
| CSV | ✓ | ✓ | Auto delimiter detection |
Excel (.xlsx) |
✓ | ✓ | via openpyxl |
Excel (.xls) |
✓ | — | via xlrd |
| Parquet | ✓ | ✓ | Columnar, fast |
| JSON / JSON Lines | ✓ | ✓ | Auto schema inference |
Non-interactive CLI reference
wrang [FILE] [OPTIONS]
Options:
--inspect Print dataset overview and exit
--output-format {text,json} Output format (default: text)
--profile Generate standalone HTML report
--sql QUERY Run DuckDB SQL against FILE (table: "data")
--compare FILE_A FILE_B Diff two datasets
--chunk-size N Stream FILE in N-row chunks
--export PATH Export dataset to PATH
--format {csv,excel,parquet,json} Export format
--version Show version and exit
--help-topic {usage,examples,formats,config}
--debug / --verbose
Testing
pip install wrang[dev]
pytest tests/ -v
# 217 passed, 2 xfailed
Contributing
- Fork the repo
- Create a feature branch
- Run the test suite — all tests must pass
- Open a pull request
Bug reports and feature requests → GitHub Issues.
License
MIT — see LICENSE.
Metadata
Release files for wrang 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wrang-0.2.2.tar.gz | 100.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wrang-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 195.0 kB
Release files / wrang-0.2.2.tar.gz
| Download URL | wrang-0.2.2.tar.gz |
|---|---|
| Size | 100.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d2a818bcd2dcce840d03738aa9dca394cd746f70be1b704e7d9e0edd3571c69
|
|
BLAKE2b-256 checksum How to use checksums |
c33c09c4cb5221c23cdbc0c506402a074cec41417b14f2ad8a9ff3754c40d180
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 14, 2026.
Transparency logRelease files / wrang-0.2.2-py3-none-any.whl
| Download URL | wrang-0.2.2-py3-none-any.whl |
|---|---|
| Size | 94.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6cd2717e84533b9ea83d08002393d37ed975725895ac9d505f129c1ef6380c11
|
|
BLAKE2b-256 checksum How to use checksums |
abc1c144cf6feca0f499cc584541280f2b3ae1cdfe7351d90dacab40f2a0998b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 14, 2026.
Transparency log