Skip to main content

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 .gitignore patterns
  • 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)

Source distribution for gitwalk 0.1.0
File Size Uploaded
gitwalk-0.1.0.tar.gz 32.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gitwalk 0.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page