Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

simple argument parser like as python-fire

Project description

a simple tiny wrapper of argument parser

  • There are already pairs of optional keywords and default values and types in function signature, and docstring as a description. just use it!
  • no more verbose code for command line options :)



def main(pos1, pos2, kw1=1, kw2=2):
    dostring as a help string
    :param pos1:
    :param pos2:
    :param kw1:
    :param kw2:

if __name__ == '__main__':
    import autoarg

just run

$ python -h

$ python --help
usage: [-h] [--kw2 KW2] [--kw1 KW1] pos1 pos2

    dostring as a help string
    :param pos1:
    :param pos2:
    :param kw1:
    :param kw2:

positional arguments:

optional arguments:
  -h, --help  show this help message and exit
  --kw2 KW2   kw2 : default = 2
  --kw1 KW1   kw1 : default = 1

if you need complex one, consider python-fire

Project details

Download files

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

Files for autoarg, version
Filename, size File type Python version Upload date Hashes
Filename, size autoarg- (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page