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

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitwalk-0.1.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

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

Hashes for gitwalk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83437d7a11e6d961808a5b5badbe4fd2d10dab5f50b23b67bd24feb4fe2d761c
MD5 4132ad5cf38a0d133b8b1da0b7297ff4
BLAKE2b-256 ef76bbcc0d31327168df2cb527078bdc3dd6edc54822d913bbfe414aaadd70a9

See more details on using hashes here.

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

Hashes for gitwalk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d63c79cc4b3d9efcb7beb8258429069211ceedf81ebce8d74d66b68083519ea
MD5 7752be74b03562210ded447622c7095b
BLAKE2b-256 b85f0654fffda9c3c1638195c3635a8bcc476bf85fe1d0d9fa9ce544413ea852

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page