Skip to main content

A very easy to use argument parser.

Project description

fargv: The laziest command-line argument parser

Installation

pip3 pip install --user --upgrade git+https://github.com/anguelos/fargv

Usage in 3 Simple Steps!

Fast argument parser

  • Immport
from fargv import fargv 
  • Define a dictionary with default parameters
params = {
    "anInt": 1,
    "aFloat": 0.1,
    "aBoolean": False,
    "anotherBoolean": True,
    "aString": "Hello",
    "aStringReference": "{aString} World",
    "anIntWithHelp": [2,"This would be the help"],
    "aChoice": [("choice1","choice2","choice3","choice4"),"And this must be the help"]
}
  • Parse user provided argv to override defaults
new_params, help_str = fargv(params)
  • In shell:
my_program -anInt 34 -aFloat=2.3 -aBoolean -anotherBoolean=False

Features:

  • Type checking
  • Automatic help generation
  • Params usable as dictionary or struct
  • Can read environmental variables as well
  • macro-parameters

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

fargv-0.1.0-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

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