A simple extension for argparse to allow readable/writeable dir types
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', type=argparsedirs.ReadableDirType)
argparser.add_argument('outdir', type=argparsedirs.WriteableDirType)
args = argparser.parse_args()
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 Distribution
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 argparsedirs-0.2.0.tar.gz.
File metadata
- Download URL: argparsedirs-0.2.0.tar.gz
- Upload date:
- Size: 1.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.2 Linux/6.1.0-26-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
043ac83e4e31ff3119b364e9429a2b8206018be99c919481ce2b3b7878f7420b
|
|
| MD5 |
5f32cdce1ee7a8f85bde26e0a61240c9
|
|
| BLAKE2b-256 |
8af1918d167f713b5f24a2431a99dda78420f3887ad1fe3226defb4ffbcfc603
|
File details
Details for the file argparsedirs-0.2.0-py3-none-any.whl.
File metadata
- Download URL: argparsedirs-0.2.0-py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.2 Linux/6.1.0-26-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25411ff59e54cdc7a734acc17db371cac0183eec38d37802646af310ba4f0625
|
|
| MD5 |
8b92871c02bb10f4cc9fee52d782ce7c
|
|
| BLAKE2b-256 |
cefadbe9befd378e20e5625600d306c2556fdaa3e2d4d94123ffee28fdbda5cc
|