Metadata-Version: 2.4
Name: dripgrep
Version: 0.1.0
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Rust
Classifier: Topic :: Database
Classifier: Topic :: Utilities
License-File: LICENSE
Summary: ripgrep-class search for structured columnar data (Parquet, Arrow, DuckDB, SQLite, Excel, CSV/TSV, JSONL)
Keywords: search,parquet,arrow,duckdb,sqlite,cli,ripgrep
Author: Jonas / dripgrep contributors
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/jonasfoe/dripgrep/blob/main/CHANGELOG.md
Project-URL: Homepage, https://github.com/jonasfoe/dripgrep
Project-URL: Issues, https://github.com/jonasfoe/dripgrep/issues
Project-URL: Repository, https://github.com/jonasfoe/dripgrep

<div align="center">
  <img src="https://raw.githubusercontent.com/jonasfoe/dripgrep/main/assets/logo.svg" alt="dripgrep logo" width="80" />
  <h1>dripgrep</h1>
  <p>
    <code>ripgrep</code>-class search for structured data — dripping with speed. Wring schema and value matches out of Parquet, Arrow, DuckDB, SQLite, Excel, and text streams in milliseconds.
  </p>
  <p>
    <a href="#current-scope"><img src="https://img.shields.io/badge/Parquet-50ABF1?style=flat-square" alt="Apache Parquet" /></a>
    <a href="#current-scope"><img src="https://img.shields.io/badge/Arrow_%2F_Feather-1E293B?style=flat-square" alt="Apache Arrow / Feather" /></a>
    <a href="#current-scope"><img src="https://img.shields.io/badge/DuckDB-FFF000?style=flat-square" alt="DuckDB" /></a>
    <a href="#current-scope"><img src="https://img.shields.io/badge/SQLite-003B57?style=flat-square" alt="SQLite" /></a>
    <a href="#current-scope"><img src="https://img.shields.io/badge/Excel_(.xlsx)-217346?style=flat-square" alt="Excel (.xlsx)" /></a>
    <a href="#current-scope"><img src="https://img.shields.io/badge/CSV_%2F_TSV-475569?style=flat-square" alt="CSV / TSV" /></a>
    <a href="#current-scope"><img src="https://img.shields.io/badge/JSONL_%2F_JSON-334155?style=flat-square" alt="JSONL / JSON" /></a>
    <a href="#current-scope"><img src="https://img.shields.io/badge/.gz_Streams-64748B?style=flat-square" alt="Gzip Streams" /></a>
    <a href="#current-scope"><img src="https://img.shields.io/badge/%2B_more…-06B6D4?style=flat-square" alt="and many more" /></a>
  </p>
  <p>
    <a href="#ai-native-development"><img src="https://img.shields.io/badge/development-AI--native-06B6D4?style=flat-square" alt="AI-Native Development" /></a>
    <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-0F172A?style=flat-square" alt="MIT License" /></a>
  </p>
</div>

<!-- MEDIA PLACEHOLDER: Add CLI hero screenshot/GIF at https://raw.githubusercontent.com/jonasfoe/dripgrep/main/assets/screenshot-cli.png (recommended 1280x720 or 960x540) before public launch -->

## Installation

### Python (`uvx` / `pip`, no Rust toolchain required)

```bash
# Run directly without installing
uvx dripgrep "email" ./testdata

# Or install globally
uv tool install dripgrep
# or: pip install dripgrep
```

### Cargo / Rust

```bash
# Install from crates.io (includes bundled DuckDB, SQLite, Parquet, Arrow, Excel, CSV/JSONL)
cargo install dripgrep

# Or download a prebuilt binary from GitHub Releases via cargo-binstall
cargo binstall dripgrep

# Lightweight pure-Rust build (skips compiling bundled libduckdb C++)
cargo install dripgrep --no-default-features
```

### From GitHub / Local Source

Requires a Rust toolchain (`rustup` / `cargo`, MSRV 1.89, edition 2024).

```bash
# Install directly from GitHub
cargo install --git https://github.com/jonasfoe/dripgrep

# Or install from a local clone
git clone https://github.com/jonasfoe/dripgrep.git
cd dripgrep
cargo install --path .
```

To try it out without installing:

```bash
cargo run --release -- --help
cargo run --release -- "email" ./testdata
```

## Current Scope

- **Formats:** Apache Parquet (`.parquet`), Apache Arrow IPC (`.arrow`, `.arrows`, `.ipc`, `.feather`), DuckDB (`.duckdb`, `.ddb`, magic-sniffed `.db`), SQLite (`.sqlite`, `.sqlite3`, magic-sniffed `.db` with `?mode=ro&immutable=1` busy fallback), Excel (`.xlsx` multi-sheet workbooks), streaming CSV/TSV (`.csv`, `.tsv`, `.csv.gz`, `.tsv.gz`), streaming JSONL/NDJSON (`.jsonl`, `.ndjson`, `.jsonl.gz`, `.ndjson.gz`), and opt-in JSON (`.json`, `.json.gz`, off by default — enable with `-t json`) including multi-member / BGZF `.gz` streams.
- **Search targets:** Schema column and nested `Struct`/JSON object field names (`field_path`), file/container metadata (`key`/`value`, plus SQLite/DuckDB table names and `.xlsx` sheet names), UTF-8 text values (`Utf8`, `LargeUtf8`, `Utf8View`, `Dictionary`, SQLite/DuckDB `TEXT`/`VARCHAR`, DuckDB `VARIANT` text/object/array values, Excel strings) top-level and inside nested Parquet/Arrow (`Struct`, `List`, `LargeList`, `FixedSizeList`, `ListView`, `Map`) or nested JSONL structures, opt-in non-text scalar pattern scanning (`--all-types` for numbers, booleans, dates, and scalar `VARIANT`), plus typed `COLUMN_GLOB:VALUE` predicates (`--where`, supporting integers, floats, booleans, SQLite `0/1` bools, `VARIANT`, and strings without brittle CSV type inference)
- **Regex engine:** Full Rust `regex` syntax, plus `--ignore-case`, `--smart-case`, and `--fixed-strings`
- **Concurrency & scheduling:** Streaming parallel directory traversal (`ignore::WalkBuilder::build_parallel`), a flat LPT (largest-file-first) priority work queue across fixed worker threads (`-j` / `--threads`, default auto; `-j 1` for deterministic sequential order), shared `ArrowReaderMetadata` Parquet row-group fan-out, `EngineBudget` concurrency permits for upcoming heavy engines, and prompt cancellation / `BrokenPipe` propagation
- **Defaults:** Searches schema, metadata, and text values together; does **not** respect `.gitignore` by default (use `--respect-gitignore` to opt in); use `--no-text` to skip uncompressed `.csv`/`.tsv`/`.jsonl`/`.json` files while keeping binary formats and `.gz` streams, or `-t`/`-T` (`--type-list`) to filter formats

## Usage

```bash
# Search schema and text values in the current directory
dripgrep "email"

# Case-insensitive regex search on a specific directory using 4 threads
dripgrep -j 4 -i "germany|france" ./testdata

# Restrict search to specific columns (values only)
dripgrep --values-only -c email -c notes "berlin" ./testdata

# Schema-only search (decodes Parquet metadata without scanning row data)
dripgrep --schema-only "first_name" ./testdata

# Metadata-only search (Parquet/Arrow key-value metadata, no row scan)
dripgrep --metadata-only "author" ./testdata

# Typed column:value trace across mixed types (skips files lacking matching columns)
dripgrep --where "user_id*:1000" ./testdata

# Repeatable --where predicates (ANDed on the same row)
dripgrep --where "user_id*:1000" --where "status:failed" ./testdata

# Skip uncompressed CSV/TSV/JSONL (keep Parquet, Arrow, and .csv.gz/.tsv.gz/.jsonl.gz)
dripgrep --no-text "email" ./testdata

# Also regex/literal-search non-text scalar columns (numbers, booleans, dates, scalar VARIANT)
dripgrep --all-types "^36$" ./testdata

# Inspect supported formats or filter by format type (-t / -T)
dripgrep --type-list
dripgrep -t parquet -t json "berlin" ./testdata
dripgrep -T csv "berlin" ./testdata

# Streaming NDJSON output capped at 5 matches per file
dripgrep --json -m 5 "gmail" ./testdata
```

### Example Output

**Terminal (default when stdout is a TTY, or force with `--heading`):**

```text
data/users.parquet
  [schema] email (Utf8)
  2:email: bob+email@berlin.de
  41:notes: Contact via email
```

**Piped / bash-friendly (default when stdout is piped, or force with `--no-heading`):**

Every line is self-contained (with no blank separator lines and newlines escaped) so standard tools like `grep`, `awk`, `cut`, and `wc -l` work directly:

```text
data/users.parquet:[schema]:email (Utf8)
data/users.parquet:2:email: bob+email@berlin.de
data/users.parquet:41:notes: Contact via email
```

**Streaming NDJSON (`--json`):**

Each file emits a `begin` frame, zero or more `match` frames (`kind: "schema"` or `kind: "value"`), and an `end` summary frame (or a non-fatal `warning` frame if an individual file fails to parse):

```json
{"type":"begin","path":"data/users.parquet","format":"parquet"}
{"type":"match","path":"data/users.parquet","table":null,"kind":"schema","column":"email","data_type":"Utf8","spans":[{"start":0,"end":5}]}
{"type":"match","path":"data/users.parquet","table":null,"kind":"value","row":2,"column":"email","value":"bob+email@berlin.de","spans":[{"start":4,"end":9}]}
{"type":"end","path":"data/users.parquet","stats":{"schema_matches":1,"value_matches":1,"rows_scanned":1000,"columns_scanned":2}}
```

## Options & Exit Codes

| Flag | Description |
| --- | --- |
| `-i`, `--ignore-case` | Case-insensitive matching |
| `-S`, `--smart-case` | Case-insensitive unless pattern has uppercase characters |
| `-F`, `--fixed-strings` | Treat pattern as a literal string |
| `--schema-only` | Search column/nested field names only (skip cell values and metadata) |
| `--values-only` | Search text cell values only (skip schema and metadata) |
| `--metadata-only` | Search file/container metadata entries only (skip schema and values) |
| `--where <COL:VALUE>` | Typed `COLUMN_GLOB:VALUE` predicate (repeatable, ANDed per row; skips `PATTERN`) |
| `-c`, `--column <NAME>` | Restrict search to column `NAME` (repeatable) |
| `-m`, `--max-count <N>` | Stop searching a file after `N` matches |
| `--heading` | Group matches under file paths (default on a TTY) |
| `--no-heading` | Prefix every match line with its file path (default when piped) |
| `--json` | Emit streaming NDJSON events |
| `--respect-gitignore` | Respect `.gitignore` / `.ignore` rules (disabled by default) |
| `--no-text` | Skip uncompressed plain-text formats (`.csv`, `.tsv`, `.jsonl`, `.json`), keeping binary and `.gz` files |
| `--all-types` | Also pattern-search non-text scalar values (numbers, booleans, dates, scalar `VARIANT`) |
| `-t`, `--type <TYPE>` | Search only files matching `TYPE` (repeatable; e.g. `-t parquet`, `-t json`) |
| `-T`, `--type-not <TYPE>` | Exclude files matching `TYPE` (repeatable; e.g. `-T csv`) |
| `--type-list` | Print all supported format types and extensions (combine with `--json` for machine output) |
| `-j`, `--threads <NUM>` | Worker thread count (`0` = auto, `1` = sequential) |

**Exit codes** (matching `ripgrep`):
- `0`: One or more matches found (or clean exit on `BrokenPipe`, e.g. `dripgrep ... | head`)
- `1`: No matches found
- `2`: Invalid arguments/pattern or fatal I/O error

## VS Code / VSCodium Extensions (Drip Ecosystem)

Use `dripgrep` directly inside VS Code, VSCodium, or Cursor with the companion extensions (`code --install-extension dripgrep.<id>`):

| Project | Role | Links |
| --- | --- | --- |
| **`dripgrep` CLI** *(this package)* | Fast Rust CLI & Python (`uvx dripgrep`) search engine | [GitHub](https://github.com/jonasfoe/dripgrep) |
| **DripGrep** | `Ctrl+Shift+F`-style Data Search sidebar powered by `dripgrep` (`dripgrep.dripgrep`) | [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=dripgrep.dripgrep) · [Open VSX](https://open-vsx.org/extension/dripgrep/dripgrep) · [GitHub](https://github.com/jonasfoe/dripgrep-vscode) |
| **DripView** | DuckDB, Parquet, Arrow, SQLite, Excel & CSV/TSV viewer + `@dripview` AI (`dripgrep.dripview`) | [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=dripgrep.dripview) · [Open VSX](https://open-vsx.org/extension/dripgrep/dripview) · [GitHub](https://github.com/jonasfoe/dripview) |
| **DripDB** | Optional MySQL & PostgreSQL connection provider for DripGrep & DripView (`dripgrep.dripdb`) | [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=dripgrep.dripdb) · [Open VSX](https://open-vsx.org/extension/dripgrep/dripdb) · [GitHub](https://github.com/jonasfoe/dripgrep-vscode-db) |

## Planned Backlog

- Additional formats: data-lake/Hadoop containers (Apache ORC `.orc` via `orc-rust`, Apache Avro `.avro`) and bioinformatics/scientific containers (`noodles`/`oxbow`, `zarrs`, `hdf5`)
- Opt-in `--binary-as-utf8` flag for raw `Binary` columns
- Parquet micro-optimizations (row-group min/max stats pruning, dictionary-page scanning)

## AI-Native Development

This project is built using an **AI-native workflow**: AI coding agents write a large share of the implementation, while architecture, design decisions, review, and automated verification are human-directed. Every change is still expected to meet normal engineering standards — clean architecture, strict typing, tests, and real verification against actual data files.

**Contributions:** AI-assisted PRs and issues are explicitly welcome (see [CONTRIBUTING.md](CONTRIBUTING.md)). The bar is the same regardless of how the code was written: keep changes focused, make sure tests and checks pass, and be able to explain and stand behind what you submit.

If you prefer software developed strictly without AI assistance, this probably isn't the project for you — no hard feelings.

## Acknowledgments & Licenses

`dripgrep` stands on the shoulders of these open-source projects:

- **[ripgrep](https://github.com/BurntSushi/ripgrep)** (Andrew Gallant / BurntSushi) — CLI ergonomics, exit codes, streaming `--json` event model, and direct reuse of `ignore`, `globset`, and `csv`.
- **[Apache Arrow® & Apache Parquet® (`arrow-rs`)](https://github.com/apache/arrow-rs)** — Native columnar, IPC/Feather, and Parquet readers (`Apache-2.0`).
- **[DuckDB](https://duckdb.org/)** (`duckdb-rs`) — Read-only embedded DuckDB database scanning (`MIT`).
- **[SQLite](https://www.sqlite.org/)** (`rusqlite`) — Read-only SQLite scanning (`MIT` / Public Domain).
- **[calamine](https://github.com/tafia/calamine)** — Pure-Rust Excel `.xlsx` reader (`MIT`).

Licensed under the [MIT License](LICENSE). See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for upstream attributions and Apache Arrow `NOTICE` notices.

