Provides a library of common option types for the argparse cammand-line options parser
Project description
Argparse Param Types
Introduction
Argparse is an excellent standard library for managing input in command-line python script, but it ships with only basic types. This project provides a library of option types that covers a lot of common use case to avoid rewriting again and again the same basic code.
Installation
pip install argparse_param_types
How to use
Available option types
file_type
directory_type
host_type
ip_type
rawip_type
ip4_type
rawip4_type
ip6_type
rawip6_type
net_type
rawnet_type
net4_type
rawnet4_type
net6_type
rawnet6_type
port_type
Changelog
0.0.3
- Add missing dependencies in pyproject (dependencies not automatically installed when pip install)
- Add a
logs
flag on each param type to allow function nesting without erroneous error logging - Bug fix: Do not log error when param_type function is used as a test in a success scenario
- Use more precise except exception class to better fit business logic and not broadly catch exceptions
0.0.2
- Refactor to be PEP8 compliant, improve/add documentation, add type hinting
- Add easy import from module __init__
- Add .gitignore to project
- Add param type host_type & ip_type & rawip_type & ip4_type & rawip4_type & ip6_type & rawip6_type & net_type & rawnet_type & net4_type & rawnet4_type & net6_type & rawnet6_type & port_type
- Add unit tests for every param type
0.0.1
- Initial commit
- Implement param type file_type & directory_type
License
MIT License © [ndmalc]
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
Close
Hashes for argparse_param_types-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a43bafa3f2353d63c938dd901cc72a4390e21bac6fca331dadfdeeec683ecc68 |
|
MD5 | 6b722b49791c1ec5282feaafb2e50411 |
|
BLAKE2b-256 | e80a6be64dfa3255b9ba0ed0eec5da0a93c1ac71a50216c0086b455f7a07f7f2 |
Close
Hashes for argparse_param_types-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73c087066330d1030e36fa81318a514d37ce993871ffc080fcff29daafe3cb14 |
|
MD5 | 1f743bc31fe9802d6782f9f5ded93ae4 |
|
BLAKE2b-256 | 1cc62fee867a101abfba6b399a0a0be9ec3a19b71a033b935c355968f1274587 |