Skip to main content

Python Bindings for the ignore crate

Project description

rignore 🚀🐍

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.

✨ Features

  • 🚀 Fast directory traversal powered by Rust
  • 🙈 Respects .gitignore rules
  • 🛠️ Customizable ignore patterns
  • 💾 Efficient memory usage
  • 🐍 Easy-to-use Python API

📦 Installation

You can install rignore using pip:

pip install rignore

🚀 Usage

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)

🔧 Advanced Usage

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,
)

📝 Parameters

  • 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.

⚡ Performance

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.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgements

  • ignore - The Rust crate that powers this project
  • PyO3 - The library used to create Python bindings for Rust code

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

rignore-0.4.2.tar.gz (13.1 kB view hashes)

Uploaded Source

Built Distributions

rignore-0.4.2-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl (1.1 MB view hashes)

Uploaded PyPy musllinux: musl 1.2+ x86-64

rignore-0.4.2-pp310-pypy310_pp73-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded PyPy musllinux: musl 1.2+ i686

rignore-0.4.2-pp310-pypy310_pp73-musllinux_1_2_armv7l.whl (1.1 MB view hashes)

Uploaded PyPy musllinux: musl 1.2+ ARMv7l

rignore-0.4.2-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl (1.1 MB view hashes)

Uploaded PyPy musllinux: musl 1.2+ ARM64

rignore-0.4.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (952.7 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

rignore-0.4.2-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (987.0 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

rignore-0.4.2-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (979.1 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

rignore-0.4.2-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (876.2 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

rignore-0.4.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (919.8 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

rignore-0.4.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl (968.2 kB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ i686

rignore-0.4.2-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl (1.1 MB view hashes)

Uploaded PyPy musllinux: musl 1.2+ x86-64

rignore-0.4.2-pp39-pypy39_pp73-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded PyPy musllinux: musl 1.2+ i686

rignore-0.4.2-pp39-pypy39_pp73-musllinux_1_2_armv7l.whl (1.1 MB view hashes)

Uploaded PyPy musllinux: musl 1.2+ ARMv7l

rignore-0.4.2-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl (1.1 MB view hashes)

Uploaded PyPy musllinux: musl 1.2+ ARM64

rignore-0.4.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (953.1 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

rignore-0.4.2-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (987.0 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

rignore-0.4.2-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (980.0 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

rignore-0.4.2-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (876.5 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

rignore-0.4.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (920.8 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

rignore-0.4.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl (970.3 kB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ i686

rignore-0.4.2-pp38-pypy38_pp73-musllinux_1_2_x86_64.whl (1.1 MB view hashes)

Uploaded PyPy musllinux: musl 1.2+ x86-64

rignore-0.4.2-pp38-pypy38_pp73-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded PyPy musllinux: musl 1.2+ i686

rignore-0.4.2-pp38-pypy38_pp73-musllinux_1_2_armv7l.whl (1.1 MB view hashes)

Uploaded PyPy musllinux: musl 1.2+ ARMv7l

rignore-0.4.2-pp38-pypy38_pp73-musllinux_1_2_aarch64.whl (1.1 MB view hashes)

Uploaded PyPy musllinux: musl 1.2+ ARM64

rignore-0.4.2-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (987.3 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

rignore-0.4.2-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (980.9 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

rignore-0.4.2-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (876.5 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

rignore-0.4.2-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (921.0 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

rignore-0.4.2-cp312-none-win_amd64.whl (719.4 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

rignore-0.4.2-cp312-none-win32.whl (642.0 kB view hashes)

Uploaded CPython 3.12 Windows x86

rignore-0.4.2-cp312-cp312-musllinux_1_2_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ x86-64

rignore-0.4.2-cp312-cp312-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ i686

rignore-0.4.2-cp312-cp312-musllinux_1_2_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ ARMv7l

rignore-0.4.2-cp312-cp312-musllinux_1_2_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ ARM64

rignore-0.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (949.8 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

rignore-0.4.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (985.3 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ s390x

rignore-0.4.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (977.3 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ppc64le

rignore-0.4.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (874.0 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARMv7l

rignore-0.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (917.4 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

rignore-0.4.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl (966.2 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.5+ i686

rignore-0.4.2-cp312-cp312-macosx_11_0_arm64.whl (814.2 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

rignore-0.4.2-cp312-cp312-macosx_10_12_x86_64.whl (861.7 kB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

rignore-0.4.2-cp311-none-win_amd64.whl (720.8 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

rignore-0.4.2-cp311-none-win32.whl (642.2 kB view hashes)

Uploaded CPython 3.11 Windows x86

rignore-0.4.2-cp311-cp311-musllinux_1_2_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ x86-64

rignore-0.4.2-cp311-cp311-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ i686

rignore-0.4.2-cp311-cp311-musllinux_1_2_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ ARMv7l

rignore-0.4.2-cp311-cp311-musllinux_1_2_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ ARM64

rignore-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (950.5 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

rignore-0.4.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl (984.8 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ s390x

rignore-0.4.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (977.5 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ppc64le

rignore-0.4.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (874.4 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARMv7l

rignore-0.4.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (918.1 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

rignore-0.4.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl (967.2 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.5+ i686

rignore-0.4.2-cp311-cp311-macosx_11_0_arm64.whl (815.0 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

rignore-0.4.2-cp311-cp311-macosx_10_12_x86_64.whl (862.4 kB view hashes)

Uploaded CPython 3.11 macOS 10.12+ x86-64

rignore-0.4.2-cp310-none-win_amd64.whl (720.7 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

rignore-0.4.2-cp310-none-win32.whl (641.9 kB view hashes)

Uploaded CPython 3.10 Windows x86

rignore-0.4.2-cp310-cp310-musllinux_1_2_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.2+ x86-64

rignore-0.4.2-cp310-cp310-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.2+ i686

rignore-0.4.2-cp310-cp310-musllinux_1_2_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.2+ ARMv7l

rignore-0.4.2-cp310-cp310-musllinux_1_2_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.2+ ARM64

rignore-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (950.7 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

rignore-0.4.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl (985.1 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ s390x

rignore-0.4.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (977.3 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ppc64le

rignore-0.4.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (874.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARMv7l

rignore-0.4.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (918.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

rignore-0.4.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl (967.5 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ i686

rignore-0.4.2-cp310-cp310-macosx_11_0_arm64.whl (814.9 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

rignore-0.4.2-cp39-none-win_amd64.whl (721.5 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

rignore-0.4.2-cp39-none-win32.whl (642.2 kB view hashes)

Uploaded CPython 3.9 Windows x86

rignore-0.4.2-cp39-cp39-musllinux_1_2_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.2+ x86-64

rignore-0.4.2-cp39-cp39-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.2+ i686

rignore-0.4.2-cp39-cp39-musllinux_1_2_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.2+ ARMv7l

rignore-0.4.2-cp39-cp39-musllinux_1_2_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.2+ ARM64

rignore-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (950.4 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

rignore-0.4.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl (985.1 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ s390x

rignore-0.4.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (977.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ppc64le

rignore-0.4.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (875.8 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARMv7l

rignore-0.4.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (918.2 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

rignore-0.4.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl (967.5 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ i686

rignore-0.4.2-cp39-cp39-macosx_11_0_arm64.whl (814.8 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

rignore-0.4.2-cp38-none-win_amd64.whl (721.1 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

rignore-0.4.2-cp38-none-win32.whl (642.1 kB view hashes)

Uploaded CPython 3.8 Windows x86

rignore-0.4.2-cp38-cp38-musllinux_1_2_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.2+ x86-64

rignore-0.4.2-cp38-cp38-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.2+ i686

rignore-0.4.2-cp38-cp38-musllinux_1_2_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.2+ ARMv7l

rignore-0.4.2-cp38-cp38-musllinux_1_2_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.2+ ARM64

rignore-0.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (950.1 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

rignore-0.4.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl (984.6 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ s390x

rignore-0.4.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (977.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ppc64le

rignore-0.4.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (875.4 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARMv7l

rignore-0.4.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (918.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

rignore-0.4.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl (967.6 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ i686

rignore-0.4.2-cp38-cp38-macosx_11_0_arm64.whl (815.5 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

rignore-0.4.2-cp38-cp38-macosx_10_12_x86_64.whl (862.8 kB view hashes)

Uploaded CPython 3.8 macOS 10.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page