Installation
Basic Installation
Install nwgrep using uv (recommended) or pip:
Note
The basic installation includes only the core nwgrep library and Narwhals. You'll need to install at least one dataframe backend separately.
With Dataframe Backends
Install nwgrep with your preferred dataframe backend(s):
Warning
cuDF is only available on Linux with Python 3.10-3.13 and requires CUDA-capable GPUs.
Command Line Interface
To use nwgrep from the command line for searching parquet/feather files:
This includes polars for efficient lazy scanning of binary formats.
Then you can use:
Development Installation
If you want to contribute or modify nwgrep:
# Clone the repository
git clone https://github.com/erichutchins/nwgrep.git
cd nwgrep
# Install with development dependencies
uv sync --group dev
This installs:
- Core testing backends (pandas, polars, pyarrow)
- Testing tools (pytest, pytest-cov)
- Linting and formatting tools (ruff, pre-commit)
See Contributing for more details on development setup.
Backend Compatibility
nwgrep works with any backend supported by Narwhals:
| Backend | Status | Notes |
|---|---|---|
| pandas | ✅ Full support | Tested with pandas >= 1.1.3 |
| polars | ✅ Full support | Supports both DataFrame and LazyFrame |
| pyarrow | ✅ Full support | - |
| daft | ✅ Full support | Supports lazy evaluation |
| dask | ✅ Full support | Distributed dataframes |
| modin | ✅ Full support | Parallel pandas |
| cuDF | ✅ Full support | GPU-accelerated (Linux only) |
| pyspark | ✅ Full support | - |
| duckdb | ✅ Full support | - |
| ibis | ✅ Full support | - |
Verifying Installation
Test your installation:
import nwgrep
import pandas as pd
df = pd.DataFrame({"col": ["hello", "world"]})
result = nwgrep.nwgrep(df, "hello")
print(result)
Expected output:
Troubleshooting
Import Errors
If you get an import error for a specific backend:
Install the missing backend:
Type Checking
nwgrep includes full type hints. For the best type checking experience, use ty (Red Knot):
Next Steps
- Usage Guide - Learn how to use nwgrep
- API Reference - Complete function reference
- CLI Reference - Command-line usage