Skip to main content

PathQuery

PathQuery is a tool to declaratively define file searches that returns a list of path.py Path objects.

Example

Search for all files recursively except in the node_modules folder and change its perms:

from pathquery import pathquery

for path in pathquery("yourdir").ext("js") - pathquery("yourdir/node_modules"):
    path.chmod(0755)

Install

To use:

$ pip install pathquery

API

Path properties can be inspected as part of the query:

pathquery("yourdir").is_dir()
pathquery("yourdir").is_not_dir()
pathquery("yourdir").is_symlink()
pathquery("yourdir").is_not_symlink()

Queries are also chainable:

for path in pathquery("yourdir").ext("pyc").is_symlink() - pathq("yourdir/node_modules"):
    path.remove()

Metadata

Release files for pathquery 0.3.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 pathquery 0.3.0
File Size Uploaded Provenance Actions
pathquery-0.3.0.tar.gz 3.1 kB Without provenance Details for pathquery-0.3.0.tar.gz

Release files / pathquery-0.3.0.tar.gz

Download URL pathquery-0.3.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1ea0f39aae038016af618725248b12d10848e63f62f8049dd47a04623eeb3a63
BLAKE2b-256 checksum
How to use checksums
6c9420a19307727a7da899e8a00bb790d45d67ba30022ce3caa8874fae4d3bc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pathquery 0.3.0

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.

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