Skip to main content

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 & Run

pip install pymanifest
python -m pymanifest --directory /path/to/include --ignore-directory /path/to/exclude --file /path/to/single/file

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


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

pymanifest-1.1-py3-none-any.whl (4.6 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