Skip to main content

About

This module is sort of like os.walk on steroids. It was created to allow the safe use of command-line path arguments in your Python scripts. For instance, say the user passes in several files and directories as arguments and you want to return a sorted list of files within said directories meeting specific access, extension, and/or size criteria. Or perhaps the user passes in a list of files and you want to verify that all of the files meet the necessary criteria before using them.

Installation

pip3 install batchpath

The batchpath module is known to be compatible with Python 3.

NOTE: This module uses os.walk(), but will use scandir’s significantly faster implementation if it is available. Consider installing the scandir module.

Usage

from batchpath import GeneratePaths()

gp = GeneratePaths()
paths = ['/path/to/directory']
files = gp.files(paths, access=os.R_OK, extensions=['conf','txt'], minsize=0, recursion=True)
from batchpath import VerifyPaths()

vp = VerifyPaths()
paths = ['/path/to/file', '/path/to/dir', '/path/to/other']
verification_status = vp.all(paths, access=os.R_OK)
invalid_paths = vp.failures

License

Copyright (c) 2015 Six (brbsix@gmail.com).

Licensed under the GPLv3 license.

Metadata

Release files for batchpath 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for batchpath 0.2
File Size Uploaded Provenance Actions
batchpath-0.2.tar.gz 3.4 kB Without provenance Details for batchpath-0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for batchpath 0.2
File Interpreter ABI Platform Actions
batchpath-0.2-py3-none-any.whl Python 3 none any Details for batchpath-0.2-py3-none-any.whl

Total release size: 8.6 kB

Release files / batchpath-0.2.tar.gz

Download URL batchpath-0.2.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e9d6c15d9ec93a2f71cc098502c7efa06b54a49c174998379083ff17b4733086
BLAKE2b-256 checksum
How to use checksums
6e1e813de6bd550ece4456da73b2d8b20f68a1c78d422deac89fb1a5b65d1dba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / batchpath-0.2-py3-none-any.whl

Download URL batchpath-0.2-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
deece446c75e39c69f00cf3330b34af5bdf75ca19accd821b24cbe3e10b148bd
BLAKE2b-256 checksum
How to use checksums
54de1d839e02d93a307726e7fe2c6b0c1e001583d9d9fb2a95c3d6dc08ba8cc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for batchpath 0.2

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.

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files No provenance

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