Skip to main content

Readable and Writeable dir action for argparse

Project description

This is a very simple action for argparse that allows you to specify a readable or a writeable directory as an argparse action. I found it on StackOverflow years ago and used it since then, unfortunately I cannot find the original source now.

I guess it would be best to have this added directly into argparse anyway.

Usage

Just import and use as an action:

import argparse
import argparsedirs

argparser = argparse.ArgumentParser()

argparser.add_argument('indir', action=argparsedirs.ReadableDir)
argparser.add_argument('outdir', action=argparsedirs.WriteableDir)

args = argparser.parse_args()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

argparsedirs-0.1.2.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

argparsedirs-0.1.2-py3-none-any.whl (2.4 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