Registry / devops / rignore

rignore

JSON →
library0.8.1pypypi✓ verified 27d ago

rignore is a Python module that provides high-performance, Rust-powered file system traversal functionality. It efficiently walks through directories while respecting various ignore rules, such as those found in `.gitignore` files. It wraps the Rust `ignore` crate using PyO3, offering a fast and customizable API. The current version is 0.7.6, with a relatively active release cadence.

pip install rignore
INSTALL
IMPORT
SIG · RIGNORE
R
rignore
devopspythonv0.8.1
Install
1.7s avg
Import
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 21MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

walk
from rignore import walk
import rignore; rignore.walk_files()
The primary function `walk` is directly available, though `import rignore` and `rignore.walk` also works. There is no `walk_files` method in the current API.

This quickstart demonstrates how to use `rignore.walk` to traverse a directory while respecting a `.gitignore` file. It creates a temporary directory structure and then prints the paths of files not ignored.

import rignore import os # Create a dummy directory structure for demonstration os.makedirs('my_project/src', exist_ok=True) os.makedirs('my_project/build', exist_ok=True) with open('my_project/.gitignore', 'w') as f: f.write('*.tmp\n') f.write('/build/\n') with open('my_project/src/main.py', 'w') as f: pass with open('my_project/src/temp.tmp', 'w') as f: pass with open('my_project/build/output.log', 'w') as f: pass print('Files found by rignore.walk:') for file_path in rignore.walk('my_project'): print(file_path) # Clean up (optional) import shutil shutil.rmtree('my_project')
Debug
Known issues
gotchaThe `overrides` parameter acts as a whitelist. If provided, only files matching these override patterns (and not explicitly excluded by a `!` in an override) will be included, effectively ignoring all other ignore rules (like `.gitignore`) unless re-included by the overrides. This can lead to unexpected file exclusions if not carefully constructed.
fix
Understand that `overrides` are powerful and take precedence. Use them specifically when you want to invert or drastically alter the default ignore behavior. For adding simple extra ignore patterns, prefer `additional_ignores`.
affects: All versions
gotchaBy default, `rignore.walk` respects standard `.gitignore` files. If you also provide `additional_ignores` or `read_git_ignore=True`, be mindful of potential redundancies or conflicting rules, especially if you expect certain files to be ignored that are later re-included by less specific `additional_ignores`.
fix
Carefully review the interaction between `.gitignore` files in the directory hierarchy and any programmatic `additional_ignores` or `overrides` you supply. Test your ignore patterns thoroughly to ensure the correct files are being processed.
affects: All versions
Errors
Common errors & fixes
error: can't find Rust compiler
The `rignore` package requires the Rust toolchain (rustc and cargo) to be installed on your system for compilation, but it was not found during `pip install`.
fix
Install the Rust toolchain using `rustup install stable` (recommended) or your operating system's package manager before running `pip install rignore`.
ModuleNotFoundError: No module named 'rignore.walker'
The `Walker` class is directly available in the top-level `rignore` package, not within a submodule named `walker`.
fix
Import `Walker` directly from the `rignore` package: `from rignore import Walker`.
AttributeError: module 'rignore' has no attribute 'walk'
The `walk` method is part of an instance of the `rignore.Walker` class, not a top-level function directly accessible from the `rignore` module.
fix
Create an instance of `rignore.Walker` and then call its `walk()` method: `walker = rignore.Walker('path/to/dir'); for entry in walker.walk(): ...`.
TypeError: argument 'path' must be str, not int
The `rignore.Walker` constructor expects its first argument, `path`, to be a string representing the directory to traverse, but a non-string type (like an integer) was provided.
fix
Ensure the `path` argument passed to `rignore.Walker` is a string: `walker = rignore.Walker('/home/user/my_project')`.
Upgrade
Version history
0.8.1latest on PyPI · released Aug 4, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
27 hits · last 30 days
node
22
OpenAI (training)
1
Resources
rignore — pip install rignore · libregistry