Skip to main content

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


Download files

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

Source Distribution

argparse_param_types-0.0.3.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

argparse_param_types-0.0.3-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file argparse_param_types-0.0.3.tar.gz.

File metadata

  • Download URL: argparse_param_types-0.0.3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for argparse_param_types-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a43bafa3f2353d63c938dd901cc72a4390e21bac6fca331dadfdeeec683ecc68
MD5 6b722b49791c1ec5282feaafb2e50411
BLAKE2b-256 e80a6be64dfa3255b9ba0ed0eec5da0a93c1ac71a50216c0086b455f7a07f7f2

See more details on using hashes here.

File details

Details for the file argparse_param_types-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for argparse_param_types-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 73c087066330d1030e36fa81318a514d37ce993871ffc080fcff29daafe3cb14
MD5 1f743bc31fe9802d6782f9f5ded93ae4
BLAKE2b-256 1cc62fee867a101abfba6b399a0a0be9ec3a19b71a033b935c355968f1274587

See more details on using hashes here.

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