Skip to main content

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 most of 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. For example, searching for timeout at -k 1 also catches timout.
  • 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 which allows 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 byteseek CLI is 1.1x to 7.5x faster than rg end 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, from PyPI:

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. --sort recent orders plain output by the file's last Git commit/last modified and --sort path orders it by path, as in rg.

byteseek -e Claude src
byteseek -i -e Claude -e GPT src

The output is similar to ripgrep/rg's.

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. --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), !=, >, >=, <, <=, or BETWEEN 100 AND 1000, and clauses join with AND. A predicate's path matches at any depth and its clauses must hold within the same object, so $.payload.latency_ms > 1000 checks every event's payload.

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

-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:

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"

View the Jupyter Notebook for more examples.

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 quality 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 Issues and Pull Requests that are submitted to this repo (particularly by agents), please manually review the output and ensure any suggestions and changes 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 pretty output depending on what information is most useful at a glance for humans

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 design and benchmarking suite were used for calibration: no library code from ripgrep is intentionally implemented.

Metadata

Release files for byteseek 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for byteseek 0.1.1
File Size Uploaded Provenance Actions
byteseek-0.1.1.tar.gz 388.1 kB Without provenance Details for byteseek-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for byteseek 0.1.1
File Actions
byteseek-0.1.1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for byteseek-0.1.1-cp311-abi3-win_amd64.whl
byteseek-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for byteseek-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl
byteseek-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details for byteseek-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl
byteseek-0.1.1-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for byteseek-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
byteseek-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for byteseek-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 13.5 MB

Release files / byteseek-0.1.1.tar.gz

Download URL byteseek-0.1.1.tar.gz
Size 388.1 kB
Tags Source
SHA-256 checksum
How to use checksums
35564bdebc5d91c92b778a430892caf7060de9e12457d8247b0f6c284ad844d6
BLAKE2b-256 checksum
How to use checksums
7871f62a17448d16fa6b2ff09673f93e5cfa6290d0193a186043f7bfa84a11e7
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.1-cp311-abi3-win_amd64.whl

Download URL byteseek-0.1.1-cp311-abi3-win_amd64.whl
Size 2.8 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
62f63ce1279cba8c0868462af238ecfddc6e2eb02fe4fe3969ca38653c5a8d82
BLAKE2b-256 checksum
How to use checksums
96e489b6210ffc62a973092d53f6fe517ee46c614405c695b1eeaf302dd8069b
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.1-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL byteseek-0.1.1-cp311-abi3-manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
fac1256d2eaa4c88657afff4c5a19583b544bdfc1c1f05cf088fa997a09683c4
BLAKE2b-256 checksum
How to use checksums
2ea62c381aabb864d44a4db0f843b97bf32ea103f20242ec627289ae6f220b46
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.1-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL byteseek-0.1.1-cp311-abi3-manylinux_2_28_aarch64.whl
Size 2.6 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
213fe7cafb6e6f209c1aefbf7054754e7e7cfdf933f144803f3bf0193299a8e5
BLAKE2b-256 checksum
How to use checksums
bb70ab680df537ad7826de3fee959ee2f63e4c85e1dbbc79c384ddc888337219
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.1-cp311-abi3-macosx_11_0_arm64.whl

Download URL byteseek-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
Size 2.5 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7521c95d059fea02e4c4c92d6d3ed1eb8a09703da49e7e529d512aa1b1fbc385
BLAKE2b-256 checksum
How to use checksums
574cc5a4e466066551468a20870f7caded7ec8c7a6aa15037d4b788c9f0fb2c7
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.1-cp311-abi3-macosx_10_12_x86_64.whl

Download URL byteseek-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl
Size 2.6 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
073b6f4c68547cb2137b917a2f428aee9e3b487b0d0230e786929b54b98b3efe
BLAKE2b-256 checksum
How to use checksums
be49df74966ab222889cc70862ad144fd953bc21a99257a2775e3e1ca0ae58ba
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.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

6 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page