Skip to main content

Traverse the file tree.

Project description

Walkmate

Traverse the file tree.

Installation

pip install walkmate

Usage

Given a multi-level directory structure:

.
├── one.py
├── two.py
└── child
    └── three.py

We can list all the files tree:

>>> tree("test/fixtures")
["one.py", "two.py", "child/three.py"]

Filter with a regex:

>>> tree("test/fixtures", r"one\.py$")
["one.py"]

Add exlude patterns too:

>>> tree("test/fixtures", r"\.py$", [r"one\.py$"])
["two.py", "child/three.py"]

Specify the maximum depth:

>>> tree("test/fixtures", depth=1)
["one.py", "two.py"]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

walkmate-1.5.0.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

walkmate-1.5.0-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page