pathfinder
A utility to find file paths.
Examples
from pathfinder import find_paths
# get all directories and sub-directories in current directory
paths = find_paths(".", just_dirs=True)
# get all files in the current directory and all sub-directories
paths = find_paths(".", just_files=True)
# get all jpg files using a regex
paths = find_paths(".", regex=".*\.jpg$")
# get all jpg files using posix wildcards
paths = find_paths(".", fnmatch="*.jpg")
# get all jpg files and png files
from pathfinder import FnmatchFilter
from pathfinder import OrFilter
jpg_filter = FnmatchFilter("*.jpg")
png_filter = FnmatchFilter("*.png")
gif_filter = FnmatchFilter("*.gif")
image_filter = OrFilter(jpg_filter, png_filter, gif_filter)
paths = find_paths(".", filter=image_filter)
# shortcut using bitwise or
paths = find_paths(".", filter=jpg_filter | png_filter | gif_filter)
# even shorter using ImageFilter to find all images
from pathfinder import ImageFilter
paths = find_paths(".", filter=ImageFilter())
# and an even shorter way
paths = ImageFilter().find(".")
Installation
To install pathfinder, simply:
$ pip install pathfinder
Development
To install development dependencies run:
$ pip install -r dev-requirements.txt
Metadata
Release files for pathfinder 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pathfinder-1.0.1.tar.gz | 7.0 kB | Without provenance | Details for pathfinder-1.0.1.tar.gz |
Release files / pathfinder-1.0.1.tar.gz
| Download URL | pathfinder-1.0.1.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f66ae343442dc2602839e9108fd12190d04fb153a89fefb1bdb40a6beff04438
|
|
BLAKE2b-256 checksum How to use checksums |
e5008335fb1602f509d2ad8feed1e0b2cf02ee85febc4bb3d7be4bfd2bde21e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Security for pathfinder 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.