File list utility
Project description
PyManifest
Description
Easily build a list of files to process with file, directory, and pattern filters.
Requirements
- Python 3.0+
- Pip
Install
pip install pymanifest
Examples
# Help command
python -m pymanifest -h
# List all files within current directory and all subdirectories ending
# in .txt
python -m pymanifest --recurse-directory . --pattern *.txt
# List all files within current directory and all subdirectories
# excluding those ending in .py
python -m pymanifest --recurse-directory . --exclude-pattern *.py
# Use directly in code to add all arguments listed from '-h' to your own
# argparse parser
ap = ArgumentParser()
pymanifest.add_args(ap)
# ... Add more args ...
args = ap.parse_args()
files = pymanifest.process_from_args(args)
# Use argument mapping to customize command line parameters to better fit
# your naming scheme. In this example, all command line parameters will
# appear with '--custom' prepended. But you can map the argument names
# to anything you like!
arg_map = {
'--file' : '--custom-file',
'--directory' : '--custom-directory',
'--recurse-directory' : '--custom-recurse-directory',
'--manifest' : '--custom-manifest',
'--exclude-file' : '--custom-exclude-file',
'--exclude-directory' : '--custom-exclude-directory',
'--exclude-recurse-directory' : '--custom-exclude-recurse-directory',
'--exclude-manifest' : '--custom-exclude-manifest',
'--pattern' : '--custom-pattern',
'--exclude-pattern' : '--custom-exclude-pattern',
}
ap = ArgumentParser()
pymanifest.add_args(ap, arg_map)
# ... Add more args ...
args = ap.parse_args()
# be sure to pass back the arg_map
files = pymanifest.process_from_args(args, arg_map)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymanifest-1.2-py3-none-any.whl.
File metadata
- Download URL: pymanifest-1.2-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6bbc8c087cdd9f4ce75a315d1efd645e3885092a7a73bf2b038fe7e96e56d31
|
|
| MD5 |
6723cc05faf49884d3e065c138339348
|
|
| BLAKE2b-256 |
f7bd1a75d953b65c56e66f667e889fe2f006f3953485b65e560c7a6e45099e3a
|