Skip to main content

Create argparser automatically from functions

Project description

Overview

A wrapper around argparser to help build CLIs from functions. Uses type-hints extensively :snake:.

PyPi Version Python Version PyPI License

Setup

:gear: Installation

Install it directly into an activated virtual environment:

$ pip install arger

or add it to your Poetry project:

$ poetry add arger

:books: 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.

Similar Projects

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.4.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

arger-0.4.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: arger-0.4.1.tar.gz
  • Upload date:
  • Size: 10.8 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.4.1.tar.gz
Algorithm Hash digest
SHA256 d0b8daec21c07296294f2b89a5ff5b2b41a0c94326f19aceb698624c3d268f01
MD5 c266f3dc0bd805349e5ae1c1d352203b
BLAKE2b-256 ea680bdcb5003fe2400207ae25e69a2d62ea09a6b761f54911e5efb2d5ff3e77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: arger-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 11.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.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9404eb17e1d1d1b55951bbc2d2703422aa4dbb78f3d8f98d3695b04d089a7fab
MD5 4628dc2e7304f50e11b433877a1ea6ac
BLAKE2b-256 beacbf66c96ecd1ee13ba00dbc0e00754267b631a927ee03f0b8603b12514df0

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