Create argparser automatically from functions
Project description
Overview
A wrapper around argparser to help build CLIs from functions. Uses typehints extensively.
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
Release history Release notifications | RSS feed
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.3.tar.gz
(9.5 kB
view details)
Built Distribution
arger-0.2.3-py3-none-any.whl
(10.5 kB
view details)
File details
Details for the file arger-0.2.3.tar.gz
.
File metadata
- Download URL: arger-0.2.3.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28236d335d5b6f4b19adf4b616a9ff3cf2785101aeef20a9b15ee39667daf533 |
|
MD5 | 9147a5696932a3ae5666495be3b369df |
|
BLAKE2b-256 | c1014f3cd848bc58d7723450de9d562c1b50fb5db13b7b53ec7a8b5e555b7b3d |
File details
Details for the file arger-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: arger-0.2.3-py3-none-any.whl
- Upload date:
- Size: 10.5 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4690ea4aae92140c839999afd93f2cc1424ebc6ac87dbf5d5a51ecb05f1bbd46 |
|
MD5 | 7c64c8fe4f43214f38ddf356e94ae7b5 |
|
BLAKE2b-256 | 54678d04397a850445696dc51ef5ee0110b5b0e853a89865bb4489cabe3cbd98 |