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.5.0.tar.gz (13.1 kB view hashes)

Uploaded Source

Built Distributions

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

Uploaded PyPy musllinux: musl 1.2+ x86-64

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

Uploaded PyPy musllinux: musl 1.2+ i686

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

Uploaded PyPy musllinux: musl 1.2+ ARMv7l

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

Uploaded PyPy musllinux: musl 1.2+ ARM64

rignore-0.5.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (940.9 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

rignore-0.5.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (977.9 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

rignore-0.5.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (966.0 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

rignore-0.5.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (865.7 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

rignore-0.5.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (906.8 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

rignore-0.5.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl (959.1 kB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ i686

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

Uploaded PyPy musllinux: musl 1.2+ x86-64

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

Uploaded PyPy musllinux: musl 1.2+ i686

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

Uploaded PyPy musllinux: musl 1.2+ ARMv7l

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

Uploaded PyPy musllinux: musl 1.2+ ARM64

rignore-0.5.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (941.7 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

rignore-0.5.0-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (979.7 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

rignore-0.5.0-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (968.0 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

rignore-0.5.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (867.8 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

rignore-0.5.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (908.6 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

rignore-0.5.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl (960.2 kB view hashes)

Uploaded PyPy manylinux: glibc 2.5+ i686

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

Uploaded PyPy musllinux: musl 1.2+ x86-64

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

Uploaded PyPy musllinux: musl 1.2+ i686

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

Uploaded PyPy musllinux: musl 1.2+ ARMv7l

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

Uploaded PyPy musllinux: musl 1.2+ ARM64

rignore-0.5.0-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl (979.5 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ s390x

rignore-0.5.0-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (967.1 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ppc64le

rignore-0.5.0-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (867.9 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

rignore-0.5.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (909.1 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

rignore-0.5.0-cp312-none-win_amd64.whl (717.0 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

rignore-0.5.0-cp312-none-win32.whl (639.9 kB view hashes)

Uploaded CPython 3.12 Windows x86

rignore-0.5.0-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.5.0-cp312-cp312-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ i686

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

Uploaded CPython 3.12 musllinux: musl 1.2+ ARMv7l

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

Uploaded CPython 3.12 musllinux: musl 1.2+ ARM64

rignore-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (938.5 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

rignore-0.5.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (976.6 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ s390x

rignore-0.5.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (963.8 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ppc64le

rignore-0.5.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (864.9 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARMv7l

rignore-0.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (905.2 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

rignore-0.5.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl (955.2 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.5+ i686

rignore-0.5.0-cp312-cp312-macosx_11_0_arm64.whl (807.2 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

rignore-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl (859.1 kB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

rignore-0.5.0-cp311-none-win_amd64.whl (717.9 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

rignore-0.5.0-cp311-none-win32.whl (642.0 kB view hashes)

Uploaded CPython 3.11 Windows x86

rignore-0.5.0-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.5.0-cp311-cp311-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ i686

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

Uploaded CPython 3.11 musllinux: musl 1.2+ ARMv7l

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

Uploaded CPython 3.11 musllinux: musl 1.2+ ARM64

rignore-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (939.1 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

rignore-0.5.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl (975.2 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ s390x

rignore-0.5.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (964.7 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ppc64le

rignore-0.5.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (865.1 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARMv7l

rignore-0.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (905.8 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

rignore-0.5.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl (956.7 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.5+ i686

rignore-0.5.0-cp311-cp311-macosx_11_0_arm64.whl (808.0 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

rignore-0.5.0-cp311-cp311-macosx_10_12_x86_64.whl (859.9 kB view hashes)

Uploaded CPython 3.11 macOS 10.12+ x86-64

rignore-0.5.0-cp310-none-win_amd64.whl (717.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 Windows x86

rignore-0.5.0-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.5.0-cp310-cp310-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.2+ i686

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

Uploaded CPython 3.10 musllinux: musl 1.2+ ARMv7l

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

Uploaded CPython 3.10 musllinux: musl 1.2+ ARM64

rignore-0.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (939.2 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

rignore-0.5.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl (975.9 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ s390x

rignore-0.5.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (964.3 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ppc64le

rignore-0.5.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (865.3 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARMv7l

rignore-0.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (905.9 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

rignore-0.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl (957.1 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ i686

rignore-0.5.0-cp310-cp310-macosx_11_0_arm64.whl (807.8 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

rignore-0.5.0-cp39-none-win_amd64.whl (718.2 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 Windows x86

rignore-0.5.0-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.5.0-cp39-cp39-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.2+ i686

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

Uploaded CPython 3.9 musllinux: musl 1.2+ ARMv7l

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

Uploaded CPython 3.9 musllinux: musl 1.2+ ARM64

rignore-0.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (939.8 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

rignore-0.5.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl (977.1 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ s390x

rignore-0.5.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (965.5 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ppc64le

rignore-0.5.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (866.1 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARMv7l

rignore-0.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (906.0 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

rignore-0.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl (958.3 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ i686

rignore-0.5.0-cp39-cp39-macosx_11_0_arm64.whl (808.4 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

rignore-0.5.0-cp38-none-win_amd64.whl (718.2 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 Windows x86

rignore-0.5.0-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.5.0-cp38-cp38-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.2+ i686

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

Uploaded CPython 3.8 musllinux: musl 1.2+ ARMv7l

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

Uploaded CPython 3.8 musllinux: musl 1.2+ ARM64

rignore-0.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (939.4 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

rignore-0.5.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl (977.1 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ s390x

rignore-0.5.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (965.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ppc64le

rignore-0.5.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (865.4 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARMv7l

rignore-0.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (906.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

rignore-0.5.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl (957.7 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ i686

rignore-0.5.0-cp38-cp38-macosx_11_0_arm64.whl (808.1 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

rignore-0.5.0-cp38-cp38-macosx_10_12_x86_64.whl (860.2 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