A fast grep tool using a Rust-powered regex extension
Project description
RYGEX
Python (with some Rust) string and regex search tool
🚀 Why RYGEX?
Tools like grep, sed, awk, tail, head are amazing—but often you find yourself piping one into another to get exactly what you need. RYGEX combines many of their capabilities in a single command-line tool, with optional Rust under-the-hood acceleration for best-in-class performance.
🛠️ Installation
- Clone the repo and enter
git clone https://github.com/jonnypeace/rygex.git cd rygex
- Install Python dependencies
pip install -r requirements.txt
- (Optional) Build and install the Rust extension
# Recommended in a python virtual environment python3 -m venv .venv maturin build --release pip install target/wheels/rygex-*.whl --force-reinstall
- (Optional) If you need to run rygex as root but keep it in your venv, add your venv’s bin/ to secure_path in /etc/sudoers:
# Pay attention to the paths of your virtual environment for this bit.... # In /etc/sudoers (via `visudo`), near the top: Defaults secure_path="/home/YOUR_USERNAME/.venv/bin:/usr/local/sbin:…" # Then, in your ~/.bashrc, auto-activate the venv: echo 'source "$HOME/.venv/bin/activate"' >> ~/.bashrc
Tested on Python 3.12+ (Ubuntu 24.04, Arch Linux). Other platforms may work but are untested.
💡 Features
- String search (
-s/--start,-e/--end, Rust-accelerated) - Fixed-string grep (
-F/--fixed-string, Rust) - Python regex (
-p/--pyreg) and Rust regex (-rp/--rpyreg) - Omit characters before/after matches (
-of,-ol,-O) - Line slicing (
-l/--lines) asstart:stop[:step] - Case-insensitive search (
-i/--insensitive) - Unique, sorted, reverse output (
-u,-S,-r) - Count matches and total matches (
-c,-t) - Multithreading (
-m/--multi) - Modular Rust library (
rygex_ext) for Python integration
📝 Usage
rygex [OPTIONS] -f <FILE>
Required arguments
You must supply one of:
-s/--start PATTERN [INDEX] -e/--end PATTERN [INDEX]-p/--pyreg <REGEX> [GROUP]-rp/--rpyreg <REGEX> [GROUP]-F/--fixed-string <PATTERN>
…and a source:
-f/--file <PATH>- piped input (e.g.
cat file | rygex -p foo). Currently, piping only works with -p as i switch support to the rust implementation.
String searches
-
Start + End
rygex -s foo 2 --end bar 1 -f logfile.txt
Finds the 2nd occurrence of
fooup to the 1stbar. -
Omit first/last chars
rygex -s "(" 1 --end ")" 1 -of 0 -ol 0 -f logfile.txt
Strips the outer parentheses from the match.
-
Omit all
rygex -s foo --end bar -O -f logfile.txt
Removes both
fooandbarfrom the ends of each match.
Regex searches
- Python regex
rygex -p '\d{4}-\d{2}-\d{2}' -f data.log
- Rust regex (faster)
rygex -rp '\w+@\w+\.\w+' -f emails.txt
You can supply an optional group index to extract capture groups:
rygex -p 'User: (\w+)' '1' -f users.log
Common options
| Flag | Description |
|---|---|
-i, --insensitive |
Case-insensitive matching |
-l, --lines SLICE |
Line slicing (e.g. 0:5, -3:, 5:10:2) |
-u, --unique |
Show unique matches only |
-S, --sort |
Sort output (combine with -r for reverse) |
-c, --counts |
Show per-match counts |
-t, --totalcounts |
Show total number of matches |
-m [CORES], --multi |
Multithreading (defaults to all available cores if no number supplied) |
-v, --version |
Show version and exit |
🔧 Roadmap
- Improve and expand docstrings
- Refactor into stable 1.0 branch
- Add more benchmarks and CI tests
- Docker container for easy deployment
- Recursive Search through directories, with excludes
- Improve Match, compile, search and Iterables (not just lists) using rust
📄 License
This project is licensed under the MIT License. See LICENSE for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rygex-0.1.11.tar.gz.
File metadata
- Download URL: rygex-0.1.11.tar.gz
- Upload date:
- Size: 489.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdf6f8f79f44e5a3eb9fd470fab79a959172398db982e673bcd7f77195cbd310
|
|
| MD5 |
e7a544f89b4dbe56da4a7a4cb02521bb
|
|
| BLAKE2b-256 |
307f52d0a92ef539b3a77824dd93ef9e38b71924c937b3309b152a616dbb3031
|
Provenance
The following attestation bundles were made for rygex-0.1.11.tar.gz:
Publisher:
build.yaml on jonnypeace/rygex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rygex-0.1.11.tar.gz -
Subject digest:
cdf6f8f79f44e5a3eb9fd470fab79a959172398db982e673bcd7f77195cbd310 - Sigstore transparency entry: 928318854
- Sigstore integration time:
-
Permalink:
jonnypeace/rygex@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Branch / Tag:
refs/pull/7/merge - Owner: https://github.com/jonnypeace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file rygex-0.1.11-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: rygex-0.1.11-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 872.2 kB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad6c4a00c1927b6f4981082a312f39c99562b6bf426e22f1d1c90a861bb739ac
|
|
| MD5 |
a7eb6ffc0690447d36f8d636e683fba1
|
|
| BLAKE2b-256 |
690bbc46ce747b82b6589158d1e9cdb6615e400e7c9d67a53328f8c84890808b
|
Provenance
The following attestation bundles were made for rygex-0.1.11-cp314-cp314-win_amd64.whl:
Publisher:
build.yaml on jonnypeace/rygex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rygex-0.1.11-cp314-cp314-win_amd64.whl -
Subject digest:
ad6c4a00c1927b6f4981082a312f39c99562b6bf426e22f1d1c90a861bb739ac - Sigstore transparency entry: 928318859
- Sigstore integration time:
-
Permalink:
jonnypeace/rygex@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Branch / Tag:
refs/pull/7/merge - Owner: https://github.com/jonnypeace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file rygex-0.1.11-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: rygex-0.1.11-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.14, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c561b84c011ecb4513bb21e74caf0498cd68df267fd3fd619e68737b9d81be13
|
|
| MD5 |
e7ec9b39d1bff2044e4eaa1925e91a1a
|
|
| BLAKE2b-256 |
2e675470a92459e516e8db1f03372c84f9f05b8ed232370be4013f063f4761c0
|
Provenance
The following attestation bundles were made for rygex-0.1.11-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:
Publisher:
build.yaml on jonnypeace/rygex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rygex-0.1.11-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -
Subject digest:
c561b84c011ecb4513bb21e74caf0498cd68df267fd3fd619e68737b9d81be13 - Sigstore transparency entry: 928318862
- Sigstore integration time:
-
Permalink:
jonnypeace/rygex@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Branch / Tag:
refs/pull/7/merge - Owner: https://github.com/jonnypeace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file rygex-0.1.11-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: rygex-0.1.11-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 872.4 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e91368a6e06942a8f41fd31c91df36adee7b9e4386fd66d93ad5d9ae86faceef
|
|
| MD5 |
e8aabbe9e2ac97495688e72159b2702e
|
|
| BLAKE2b-256 |
aed597f02022a473108080de733f2b1e2c6358ee3026f3342eb5ed4c688c1f13
|
Provenance
The following attestation bundles were made for rygex-0.1.11-cp313-cp313-win_amd64.whl:
Publisher:
build.yaml on jonnypeace/rygex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rygex-0.1.11-cp313-cp313-win_amd64.whl -
Subject digest:
e91368a6e06942a8f41fd31c91df36adee7b9e4386fd66d93ad5d9ae86faceef - Sigstore transparency entry: 928318867
- Sigstore integration time:
-
Permalink:
jonnypeace/rygex@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Branch / Tag:
refs/pull/7/merge - Owner: https://github.com/jonnypeace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file rygex-0.1.11-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: rygex-0.1.11-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13561dbd2584d2f7d56e5226685a1298996089058d97ec91dfb9d815bf36bd71
|
|
| MD5 |
3a77a94355d1e4ed21ccd6ad5fb88b10
|
|
| BLAKE2b-256 |
e48d0d9fffd9b2bffe4493fd5af1e587fcfdbab41a3a2c995037b0c75edd27a7
|
Provenance
The following attestation bundles were made for rygex-0.1.11-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:
Publisher:
build.yaml on jonnypeace/rygex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rygex-0.1.11-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -
Subject digest:
13561dbd2584d2f7d56e5226685a1298996089058d97ec91dfb9d815bf36bd71 - Sigstore transparency entry: 928318864
- Sigstore integration time:
-
Permalink:
jonnypeace/rygex@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Branch / Tag:
refs/pull/7/merge - Owner: https://github.com/jonnypeace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file rygex-0.1.11-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: rygex-0.1.11-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 872.4 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c45a1b4e0affc8ef2a2a10134c548fe779ab5a24550c922ddb5fd9c69bbd0fa8
|
|
| MD5 |
18ce518636ab9afc33298dff65692021
|
|
| BLAKE2b-256 |
6dba87f6446f7a8042f530d27eb2370240482621ac1f0440c45cf86ebe35d1cc
|
Provenance
The following attestation bundles were made for rygex-0.1.11-cp312-cp312-win_amd64.whl:
Publisher:
build.yaml on jonnypeace/rygex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rygex-0.1.11-cp312-cp312-win_amd64.whl -
Subject digest:
c45a1b4e0affc8ef2a2a10134c548fe779ab5a24550c922ddb5fd9c69bbd0fa8 - Sigstore transparency entry: 928318857
- Sigstore integration time:
-
Permalink:
jonnypeace/rygex@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Branch / Tag:
refs/pull/7/merge - Owner: https://github.com/jonnypeace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file rygex-0.1.11-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: rygex-0.1.11-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e79803b055678fb567f09c373da2d5a4c4cee6e6bc71f2913f910abca6d498e
|
|
| MD5 |
43bec1fc8f8129109bdddbfb9dff60d1
|
|
| BLAKE2b-256 |
b42fe4464fe2f1ed041319a0b56e604de73da88d8edeef841785caa117704de1
|
Provenance
The following attestation bundles were made for rygex-0.1.11-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:
Publisher:
build.yaml on jonnypeace/rygex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rygex-0.1.11-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -
Subject digest:
4e79803b055678fb567f09c373da2d5a4c4cee6e6bc71f2913f910abca6d498e - Sigstore transparency entry: 928318863
- Sigstore integration time:
-
Permalink:
jonnypeace/rygex@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Branch / Tag:
refs/pull/7/merge - Owner: https://github.com/jonnypeace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@100403e3d0e2f10297ea2cd63746b76d7e6a1095 -
Trigger Event:
pull_request
-
Statement type: