byteseek
byteseek is modern reimplementation of grep for logs, code, and structured data, with a command-line tool that is a drop-in replacement for ripgrep at faster speeds with a few more fancy tools.
byteseek can also parse JSON, YAML, and TOML files and search them by jq-style path, by value, or with predicates such as $.payload.latency_ms > 1000.
For humans, byteseek has -p/--pretty output options which provide more semantic context and accessible coloring to the output, making it much easier to process at-a-glance.
More useful features of byteseek:
- Fuzzy matching with
-k/--max-errors, which finds text within N typos (insertions, deletions, or substitutions) of a pattern. A search fortimeoutat-k 1also catchestimout. - Boolean queries with
--query, which select lines that contain every required term in any order, such as'ERROR AND payments AND NOT retrying'. - Python bindings with full type hints that release the GIL while searching, so searches from multiple threads run in parallel. See the Jupyter Notebook for more demos.
- Strong performance at a low memory footprint: on ripgrep's own benchmark corpora, the
byteseekCLI is 1.1x to 7.5x faster thanrgend to end with about half of its peak memory, and the Python bindings significantly surpassing optimized packages in this domain such as pyahocorasick and orjson. (Benchmarks)
Installation
The CLI installs from crates.io with Cargo (Rust 1.96+):
cargo install byteseek
In Python:
pip3 install byteseek
uv pip install byteseek
The Python package also installs the full byteseek command line, compiled into the package itself, so byteseek (or python -m byteseek) works without Cargo and takes the same flags as the native binary.
Usage
Run byteseek with a pattern to search every file under the current directory, skipping hidden files, binary files, and anything matched by a .gitignore. Any ripgrep command that uses literal patterns works unchanged, including -e for multiple patterns, -i/-S for case, -w/-x for whole words and lines, -A/-B/-C for context, -c/-l/-o for counts, files, and matches, -g/-t for globs and file types, and --column/-0 for editors and xargs.
The output is similar to ripgrep/rg's, byte for byte, down to its colors and the order files print in, as their searches finish: this search through the source of axum for how it limits request bodies is the same one shown with --pretty at the top of this README, which lists files the most recently changed first instead. --sort recent orders plain output that way and --sort path orders it by path, as in rg.
Structured Search
A pattern starting with $. or $[ parses each file as a document in the format its extension names: .json, .jsonl, or .ndjson for JSON, .yaml or .yml for YAML, and .toml for TOML. Directories are searched for those files only. --parse json, --parse yaml, or --parse toml picks the format instead, such as for a file with another extension or for stdin. Every pattern then matches one of three ways:
- Plain text matches inside scalar values, such as
failed. - A pattern starting with
$matches a path exactly, such as$.replicas, or a path with the value written after an=without spaces, such as$.service=payments. - A predicate compares values with
==(or=with spaces around it),!=,>,>=,<,<=, orBETWEEN 100 AND 1000, and clauses join withAND. A predicate's path matches at any depth and its clauses must hold within the same object, so$.payload.latency_ms > 1000checks every event'spayload.
Each match prints as PATH:VALUE, here listing the React and TypeScript versions that each package of a monorepo depends on:
With --pretty, each file's paths and values line up in columns:
Predicates compare numbers, strings, booleans, and RFC 3339 timestamps, and skip values that are null or of another type; --strict makes those an error instead. A quoted literal is always a string or a timestamp, so == "2018" matches the string "2018" and not the number 2018.
JSON Lines are searched like jq reads them: each value is its own document whose paths start at $, so a log with one event per line can be filtered with '$.level == "error" AND $.latency_ms > 1000'.
Pretty Output
-p/--pretty is opt-in as its layout differs from ripgrep's and it is optimized for better human readbility. JSON/YAML/TOML syntax highlighting will be displayed for those searches.
JSON
YAML
TOML
Fuzzy and Boolean Predicate Search
-k N also matches text within N edits of each pattern, which catches typos and OCR errors that an exact search misses. --query treats each pattern as a boolean query over the terms in a line, in any order, and highlights the terms that made the line match:
In-Memory Searcher APIs
Python
A Searcher compiles its patterns once and searches strings, files, or whole directories. Match offsets are UTF-8 byte offsets, and pattern_index says which pattern matched.
from pathlib import Path
from byteseek import CaseMode, SearchConfig, Searcher
searcher = Searcher(["error", "timeout"], SearchConfig(case_mode=CaseMode.ASCII_INSENSITIVE))
text = Path("logs/worker.log").read_text()
for line in searcher.find_lines(text):
print(line.line_number, line.line)
searcher.count(text) # 3
searcher.contains("all good") # False
for result in searcher.find_path("src"):
print(result.path, len(result.matches))
SearchConfig also takes options such as whole_word, max_matches, max_edit_distance for fuzzy matching, and boolean_queries. Enum options also accept their string values, such as structured_mode="json". For structured search, set structured_mode:
from byteseek import StructuredMode
events = Searcher(
["failed", "$.payload.latency_ms > 1000"],
SearchConfig(structured_mode=StructuredMode.JSON),
)
for result in events.find_structured_path("data"):
for match in result.matches:
print(match.path, match.node_text)
$.events[1].payload.latency_ms 3011
$.events[1].payload.status "failed"
$.events[4].payload.latency_ms 2200
$.events[4].payload.status "failed"
Jupyter Notebook with a tour of the Python API.
Rust
The same Searcher is available as a Rust library. Turning off the default cli feature leaves out the command-line tool's dependencies:
[dependencies]
byteseek = { version = "0.1", default-features = false }
use byteseek::{CaseMode, SearchConfig, Searcher};
let config = SearchConfig::builder()
.case_mode(CaseMode::AsciiInsensitive)
.build();
let searcher = Searcher::new(["error", "timeout"], config)?;
for line in searcher.find_lines(&text) {
println!("{}: {}", line.line_number, line.line);
}
let report = searcher.report_path("logs")?;
println!("{}", report.render_top_files_table(10));
Performance
These results are for ripgrep's own benchsuite searches on its English subtitles corpus, comparing the byteseek and rg (16.0.0) command-line tools end to end on an Apple M3 Pro: each run starts a process, reads the file, and writes a count of matching lines.
See BENCHMARKS.md for absolute timings and Python comparisons.
AI Disclosure
byteseek was mostly made using Claude Opus 5.5 and Fable 5.2 with checks and balances as an experiment into how far an agent can push a search engine's performance against ripgrep, one of the most heavily optimized command-line tools there is.
For any pull requests that are submitted to this repo (particularly by agents), please manually review the output and ensure any changes and suggestions are high signal and precisely scoped: both a) low-effort PRs that cause more problems than they solve and b) nontechnical discussions about the use of agentic development may be closed without comment.
Miscellaneous Notes
- The terminal screenshots were made using vhs with an additional postprocessing step that crops each screenshot to only its text. The tapes are available in the demo folder.
To Be Added
- More tests with real-world data
- More feature parity with ripgrep (still deciding on which important features are NYI)
- May need to revaluate faded coloring semantics for
prettyoutput depending on what information is most useful at a glance
Maintainer/Creator
Max Woolf (@minimaxir)
Max's open-source projects are supported by his Patreon and GitHub Sponsors. If you found this project helpful, any monetary contributions to the Patreon are appreciated and will be put to good creative use.
License
MIT
The MIT LICENSE for ripgrep is also included as its base benchmarking suite was used for calibration: no algorithmic code from ripgrep is intentionally implemented.
Metadata
Release files for byteseek 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| byteseek-0.1.0.tar.gz | 388.3 kB | Without provenance | Details for byteseek-0.1.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| byteseek-0.1.0-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details for byteseek-0.1.0-cp311-abi3-win_amd64.whl |
| byteseek-0.1.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ x86-64 | Details for byteseek-0.1.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| byteseek-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ ARM64 | Details for byteseek-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| byteseek-0.1.0-cp311-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64 | Details for byteseek-0.1.0-cp311-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
Total release size: 14.2 MB
Release files / byteseek-0.1.0.tar.gz
| Download URL | byteseek-0.1.0.tar.gz |
|---|---|
| Size | 388.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd3b0f563e264d44f110a9b07ef4d5b3476cfb3847b22c5fb5841fef7bc5fedd
|
|
BLAKE2b-256 checksum How to use checksums |
5a40b1fc3c3d97e38c3c444c6132e31eeb7b68f2202e6132de5594b3624d37d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / byteseek-0.1.0-cp311-abi3-win_amd64.whl
| Download URL | byteseek-0.1.0-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
62ebbf6b4be7bdfae1799e4e2c005fd93d273e55e05b2b9f2bcc57bcc8561d3d
|
|
BLAKE2b-256 checksum How to use checksums |
39f3fcd512377388bcb90ca9190d07af96eb53d917245dbef3caa0a593de1511
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / byteseek-0.1.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | byteseek-0.1.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
d85630c0c1f7c95f1ec16f4a89af38dc84dfc3872ca3342596f73d8d45523e62
|
|
BLAKE2b-256 checksum How to use checksums |
8c09381155b041464d474fb201b4116faaa5376365b90092a2023edca2594c1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / byteseek-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | byteseek-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
8a69482aca2ec538f268c45312fa9b0d541866a6b417ec2400e29ce3a72a7d7a
|
|
BLAKE2b-256 checksum How to use checksums |
8f01d04f61e2dc416e13d3b7fa6c0d32912c0f6bea632ffa30c7911ae6cdbc35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / byteseek-0.1.0-cp311-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
| Download URL | byteseek-0.1.0-cp311-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.11 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6b473c4210513f7dc24e586ef841acfd00d4cb096ce4bdeb43ef0bfa41d65b04
|
|
BLAKE2b-256 checksum How to use checksums |
6a0e8b22bca7516600c9ebcfae41f5300f46f316da5c6c78651e30f2271ecef4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for byteseek 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.