{"id":21453,"library":"ignore-python","title":"ignore-python","description":"Python bindings for the Rust `ignore` crate, providing fast, parallel filesystem traversal with gitignore-style pattern matching. Currently at version 0.3.3, released periodically. Supports Python >=3.8.","status":"active","version":"0.3.3","language":"python","source_language":"en","source_url":"https://github.com/samuelcolvin/ignore-python","tags":["filesystem","gitignore","walk","pattern-matching"],"install":[{"cmd":"pip install ignore-python","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Python bindings rely on the Rust `ignore` crate; bundled in the package.","package":"ignore","optional":false}],"imports":[{"note":"Most classes are in submodules; direct `import ignore` gives you the top-level module, not the Rust bindings.","wrong":"import ignore","symbol":"Walk","correct":"from ignore import Walk"},{"note":"The class is called `Ignore`, not `GitIgnore`.","wrong":"from ignore import GitIgnore","symbol":"Ignore","correct":"from ignore import Ignore"},{"note":"IgnoreFilter is exposed at the top-level; there is no `filter` submodule.","wrong":"from ignore.filter import IgnoreFilter","symbol":"IgnoreFilter","correct":"from ignore import IgnoreFilter"},{"note":"`types` is a module, not a class; import it as a module to access enums like `FileType`.","wrong":"from ignore import Types","symbol":"types","correct":"from ignore import types"}],"quickstart":{"code":"from ignore import Walk\n\nwalker = Walk('./src', produce_gitignore=True)\nfor path in walker:\n    print(path)","lang":"python","description":"Walks the ./src directory, respecting .gitignore rules."},"warnings":[{"fix":"Use `path.resolve()` or join with root if absolute paths are needed.","message":"The `Walk` iterator yields `Path` objects relative to the root, not absolute paths.","severity":"gotcha","affected_versions":"all"},{"fix":"Pass `hidden=True` to include hidden files.","message":"Default behavior excludes hidden files (those starting with '.') unless `hidden=False` is passed.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `Ignore(patterns=['*.pyc', '__pycache__/'])` instead of `Ignore(match=['*.pyc'])`.","message":"The `Ignore` class constructor changed between 0.2.x and 0.3.x; now requires a `patterns` argument of type `List[str]`.","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Replace `Walk(path, gitignore=True)` with `Walk(path, produce_gitignore=True)`.","message":"In version 0.3.0, the `Walk` class removed the `gitignore` parameter (use `produce_gitignore` instead).","severity":"breaking","affected_versions":">=0.3.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `from ignore import Ignore`.","cause":"The class is called `Ignore`, not `GitIgnore`.","error":"ImportError: cannot import name 'GitIgnore' from 'ignore'"},{"fix":"Use `Ignore(patterns=['*.pyc'])` instead of `Ignore(['*.pyc'])`.","cause":"The constructor signature changed in 0.3.0; `patterns` must be passed as a keyword argument.","error":"TypeError: Ignore() takes 1 positional argument but 2 were given"},{"fix":"Use `from ignore import Walk`.","cause":"`import ignore` gives the top-level module, not the Rust bindings.","error":"AttributeError: module 'ignore' has no attribute 'Walk'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}