Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

106 строки
3.7 KiB

  1. Metadata-Version: 2.4
  2. Name: rignore
  3. Version: 0.6.4
  4. Classifier: Programming Language :: Rust
  5. Classifier: Programming Language :: Python :: Implementation :: CPython
  6. Classifier: Programming Language :: Python :: Implementation :: PyPy
  7. License-File: LICENSE
  8. Summary: Python Bindings for the ignore crate
  9. Author-email: Patrick Arminio <patrick.arminio@gmail.com>
  10. License: MIT
  11. Requires-Python: >=3.8
  12. Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
  13. # rignore 🚀🐍
  14. `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.
  15. ## ✨ Features
  16. - 🚀 Fast directory traversal powered by Rust
  17. - 🙈 Respects `.gitignore` rules
  18. - 🛠️ Customizable ignore patterns
  19. - 💾 Efficient memory usage
  20. - 🐍 Easy-to-use Python API
  21. ## 📦 Installation
  22. You can install `rignore` using pip:
  23. ```bash
  24. pip install rignore
  25. ```
  26. ## 🚀 Usage
  27. The main function provided by `rignore` is `walk`, which returns an iterator of file paths:
  28. ```python
  29. import rignore
  30. for file_path in rignore.walk("/path/to/directory"):
  31. print(file_path)
  32. ```
  33. ### 🔧 Advanced Usage
  34. The `walk` function accepts several optional parameters to customize its behavior:
  35. ```python
  36. rignore.walk(
  37. path,
  38. ignore_hidden=None,
  39. read_ignore_files=None,
  40. read_parents_ignores=None,
  41. read_git_ignore=None,
  42. read_global_git_ignore=None,
  43. read_git_exclude=None,
  44. require_git=None,
  45. additional_ignores=None,
  46. additional_ignore_paths=None,
  47. max_depth=None,
  48. max_filesize=None,
  49. follow_links=None,
  50. case_insensitive=None,
  51. same_file_system=None,
  52. filter_entry=None,
  53. )
  54. ```
  55. #### 📝 Parameters
  56. - `path` (str): The root directory to start the walk from.
  57. - `ignore_hidden` (bool, optional): Whether to ignore hidden files and directories.
  58. - `read_ignore_files` (bool, optional): Whether to read `.ignore` files.
  59. - `read_parents_ignores` (bool, optional): Whether to read ignore files from parent directories.
  60. - `read_git_ignore` (bool, optional): Whether to respect `.gitignore` files.
  61. - `read_global_git_ignore` (bool, optional): Whether to respect global Git ignore rules.
  62. - `read_git_exclude` (bool, optional): Whether to respect Git exclude files.
  63. - `require_git` (bool, optional): Whether to require the directory to be a Git repository.
  64. - `additional_ignores` (List[str], optional): Additional ignore patterns to apply.
  65. - `additional_ignore_paths` (List[str], optional): Additional ignore file paths to read.
  66. - `max_depth` (int, optional): Maximum depth to traverse.
  67. - `max_filesize` (int, optional): Maximum file size to consider (in bytes).
  68. - `follow_links` (bool, optional): Whether to follow symbolic links.
  69. - `case_insensitive` (bool, optional): Whether to use case-insensitive matching for ignore patterns.
  70. - `same_file_system` (bool, optional): Whether to stay on the same file system.
  71. - `filter_entry` (Callable[[str, bool], optional): Custom filter function to exclude entries.
  72. ## ⚡ Performance
  73. `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.
  74. ## 🤝 Contributing
  75. Contributions are welcome! Please feel free to submit a Pull Request.
  76. ## 📄 License
  77. This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
  78. ## 🙏 Acknowledgements
  79. - [ignore](https://github.com/BurntSushi/ripgrep/tree/master/crates/ignore) - The Rust crate that powers this project
  80. - [PyO3](https://github.com/PyO3/pyo3) - The library used to create Python bindings for Rust code