Skip to main content

Create argparser automatically from functions

Project description

Overview

A wrapper around argparser to help build CLIs from functions. Uses typehints extensively.

PyPi Version Python Version PyPI License

Setup

Installation

Install it directly into an activated virtual environment:

$ pip install arger

or add it to your Poetry project:

$ poetry add arger

Usage

  • create a python file called test.py
from arger import Arger

def main(param1: int, param2: str, kw1=None, kw2=False):
    """Example function with types documented in the docstring.

    :param param1: The first parameter.
    :param param2: The second parameter.
    """
    print(locals())


if __name__ == '__main__':
    Arger(main).run()
  • run this normally with
$ python test.py 100 param2
  • Checkout examples folder and documentation to see more of arger in action.

Alternatives

argh

  • has similar goals as to ease up using argparser.
  • doesn't support type hints.
  • No recent releases.

typer

  • if you are using click, I highly recommend you to check this library.
  • it is neat and many features are inspired from this library.
  • doesn't support loading help text for arguments from docstrings.

invoke

  • doesn't support type hints.

cliche

  • has similar goals.
  • doesn't cover much use cases as arger.

This project was generated with cookiecutter using jacebrowning/template-python.

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

arger-0.2.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

arger-0.2.2-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file arger-0.2.2.tar.gz.

File metadata

  • Download URL: arger-0.2.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.0.0-1035-azure

File hashes

Hashes for arger-0.2.2.tar.gz
Algorithm Hash digest
SHA256 7164f560362a1ecce1e44de317d9ea7eff37aa317102e57e3548202944fc84b3
MD5 97efe5a480f7dbc90175a1d14b5958c2
BLAKE2b-256 4a55f81878f9faebd0c1350acecad908de053b4657d8ad863c5122831955b3fd

See more details on using hashes here.

File details

Details for the file arger-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: arger-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.0.0-1035-azure

File hashes

Hashes for arger-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c7dbc2bc8040632d6f7833efa60201b304a2407c73a2de20b84b9125c437df5d
MD5 e4daefc925075c80cbcc7551dc5baf52
BLAKE2b-256 e70cd839bedcaa8182a6802bcb60dbb7050518898148d39d4da04d37c5e76b95

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