Skip to main content

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


Download files

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

Source Distribution

more argparse-1.0.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distributions

more_argparse-1.0.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

more_argparse-1.0.0-py2-none-any.whl (3.2 kB view details)

Uploaded Python 2

File details

Details for the file more argparse-1.0.0.tar.gz.

File metadata

  • Download URL: more argparse-1.0.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for more argparse-1.0.0.tar.gz
Algorithm Hash digest
SHA256 13778f1ed8b9519682c39a0a1df39e741e0352ae25cfe400940304c1a9df8cf8
MD5 8fa62f4344bf761151931e3ae88d7c6f
BLAKE2b-256 73b38452208ed786d11d601ce40bfb084cb3846a85e2ff20e6d74cda0c6d332d

See more details on using hashes here.

Provenance

File details

Details for the file more_argparse-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: more_argparse-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for more_argparse-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0a2211de3e41c34e788a6880e6e0c7b211461ec8b8cb2072ec44668df2c37b6
MD5 7a31c8284d99b3c052b3d4e44d2d3d45
BLAKE2b-256 9375753919a07218d030901167c79f953af49447c4b5215a1fe3b4dd7cc02960

See more details on using hashes here.

Provenance

File details

Details for the file more_argparse-1.0.0-py2-none-any.whl.

File metadata

  • Download URL: more_argparse-1.0.0-py2-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

File hashes

Hashes for more_argparse-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 21f419de1a3cf4bfe52a47d4299241598b9ead94c852c82ad75cc47d8c0e55a1
MD5 4309af042ff876e89b0d337bc71178ce
BLAKE2b-256 8c25ec3b1fd19d3f1f4c99391384fabaab797c6cc19f8350ad8d23e6f02aee3b

See more details on using hashes here.

Provenance

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