A directory walker that respects .gitignore rules
Project description
gitwalk
A Python library that provides an os.walk()-compatible interface that respects .gitignore rules. Walk through your directories while automatically excluding paths matched by .gitignore patterns.
Installation
Using uv:
uv pip install gitwalk
Usage
from gitwalk import gitwalk as walk
# Walk through directory respecting .gitignore rules
for dirpath, dirnames, filenames in walk("./my_project"):
print(f"Directory: {dirpath}")
print(f"Subdirectories: {dirnames}")
print(f"Files: {filenames}")
Features
- Same interface as
os.walk() - Respects
.gitignorepatterns - Supports both topdown and bottom-up traversal
- Handles error callbacks
- Follows symbolic links (optional)
Tests
uv pip install -e ".[test]"
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gitwalk-0.1.0.tar.gz
(32.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitwalk-0.1.0.tar.gz.
File metadata
- Download URL: gitwalk-0.1.0.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83437d7a11e6d961808a5b5badbe4fd2d10dab5f50b23b67bd24feb4fe2d761c
|
|
| MD5 |
4132ad5cf38a0d133b8b1da0b7297ff4
|
|
| BLAKE2b-256 |
ef76bbcc0d31327168df2cb527078bdc3dd6edc54822d913bbfe414aaadd70a9
|
File details
Details for the file gitwalk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gitwalk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d63c79cc4b3d9efcb7beb8258429069211ceedf81ebce8d74d66b68083519ea
|
|
| MD5 |
7752be74b03562210ded447622c7095b
|
|
| BLAKE2b-256 |
b85f0654fffda9c3c1638195c3635a8bcc476bf85fe1d0d9fa9ce544413ea852
|