Extra types and actions for argparse
Project description
Intro
Getting Started
Installing
First install with:
$ python3 -m pip install more-argparse
Importing
Then you import it with either:
import argparse
import margparse
or
from argparse import *
from margparse import *
It's important that you do the same for both.
Checking the Contents of margparse
First, open a Python interactive session:
$ python3
Then, import it and check the contents:
>>> import margparse
>>> dir(margparse)
['GlobbingType', '__all__', '__author__', '__builtins__', '__cached__', '__contibutor__', '__doc__', '__file__', '__license__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__title__', '__version__', '_actions_all', '_common', '_types_all', 'actions', 'types']
Have ideas for possible types or actions?
If you have ideas for more types or actions to be included in more-argparse, simply create an issue tagged "Feature Request" and enter your hopes and dreams for the type or action. If you have written a custom type or action in the past feel free to include the code in your issue. Better yet, include the code in the repository yourself and submit a pull request.
Contents
Types
GlobbingType
If the argument is a glob, glob the argument and add each filename to a list as basetype(filename)
, otherwise return [basetype(argument)]
Arguments
Name | Type | Description |
---|---|---|
basetype | callable | see above; use case: basetype=argparse.FileType('r') |
recursive | bool | passed to glob.glob |
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 Distributions
Hashes for more_argparse-1.0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1caa97b7a728b9610e1770f6dfed0d960b2bfe59b37501704a5874e67a8357fc |
|
MD5 | c5d8dd96210fb00578f0269a385f2cf9 |
|
BLAKE2b-256 | 5264ad7a4da5477d78f46fe1bb748d8f7ba9f37df9e5599a63a870a1f4da9d13 |
Hashes for more_argparse-1.0.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37e20c37b0bdd1ff8018d780e63152cb82bcb3826e34517e13be8d0dfb869fc6 |
|
MD5 | c669ee2d6dab2de9c3e2a9860b07ea70 |
|
BLAKE2b-256 | 05972c48e8106586dd202b42580bac06230ca398bf686927e1c71e4882c6a60e |