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
Metadata
Release files for gitwalk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gitwalk-0.1.0.tar.gz | 32.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gitwalk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.3 kB
Release files / gitwalk-0.1.0.tar.gz
| Download URL | gitwalk-0.1.0.tar.gz |
|---|---|
| Size | 32.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83437d7a11e6d961808a5b5badbe4fd2d10dab5f50b23b67bd24feb4fe2d761c
|
|
BLAKE2b-256 checksum How to use checksums |
ef76bbcc0d31327168df2cb527078bdc3dd6edc54822d913bbfe414aaadd70a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.14
|
Release files / gitwalk-0.1.0-py3-none-any.whl
| Download URL | gitwalk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 2.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d63c79cc4b3d9efcb7beb8258429069211ceedf81ebce8d74d66b68083519ea
|
|
BLAKE2b-256 checksum How to use checksums |
b85f0654fffda9c3c1638195c3635a8bcc476bf85fe1d0d9fa9ce544413ea852
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.14
|