Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
rignore
is a Python module that provides a high-performance, Rust-powered file system traversal functionality. It wraps the Rust ignore
crate using PyO3, offering an efficient way to walk through directories while respecting various ignore rules.
.gitignore
rulesYou can install rignore
using pip:
pip install rignore
The main function provided by rignore
is walk
, which returns an iterator of file paths:
import rignore
for file_path in rignore.walk("/path/to/directory"):
print(file_path)
The walk
function accepts several optional parameters to customize its behavior:
rignore.walk(
path,
ignore_hidden=None,
read_ignore_files=None,
read_parents_ignores=None,
read_git_ignore=None,
read_global_git_ignore=None,
read_git_exclude=None,
require_git=None,
additional_ignores=None,
additional_ignore_paths=None,
max_depth=None,
max_filesize=None,
follow_links=None,
case_insensitive=None,
same_file_system=None,
filter_entry=None,
)
path
(str): The root directory to start the walk from.ignore_hidden
(bool, optional): Whether to ignore hidden files and directories.read_ignore_files
(bool, optional): Whether to read .ignore
files.read_parents_ignores
(bool, optional): Whether to read ignore files from parent directories.read_git_ignore
(bool, optional): Whether to respect .gitignore
files.read_global_git_ignore
(bool, optional): Whether to respect global Git ignore rules.read_git_exclude
(bool, optional): Whether to respect Git exclude files.require_git
(bool, optional): Whether to require the directory to be a Git repository.additional_ignores
(List[str], optional): Additional ignore patterns to apply.additional_ignore_paths
(List[str], optional): Additional ignore file paths to read.max_depth
(int, optional): Maximum depth to traverse.max_filesize
(int, optional): Maximum file size to consider (in bytes).follow_links
(bool, optional): Whether to follow symbolic links.case_insensitive
(bool, optional): Whether to use case-insensitive matching for ignore patterns.same_file_system
(bool, optional): Whether to stay on the same file system.filter_entry
(Callable[[str, bool], optional): Custom filter function to exclude entries.rignore
leverages the power of Rust to provide high-performance directory traversal. It's significantly faster than pure Python implementations, especially for large directory structures.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Python Bindings for the ignore crate
We found that rignore demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.