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.0.tar.gz
(9.4 kB
view details)
Built Distribution
arger-0.2.0-py3-none-any.whl
(9.9 kB
view details)
File details
Details for the file arger-0.2.0.tar.gz
.
File metadata
- Download URL: arger-0.2.0.tar.gz
- Upload date:
- Size: 9.4 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 | 49afc29c32c65ee8a0dab4928e6b9525a3e0185bd4cd7f0fd9e01aca0669dec6 |
|
MD5 | e61d429bf5fa739bc26fb697c0fc7041 |
|
BLAKE2b-256 | ad41ea394acc704c118f08f575b0a084219725025df7b686bb8eaa8f3507239c |
File details
Details for the file arger-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: arger-0.2.0-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fa50ed45bd3ca6d7c256bb152749ce4c0918619a782cafa000ce1ba385d2c2d |
|
MD5 | 1b57359b043e1fbef1f40fc97334ca6c |
|
BLAKE2b-256 | a4da0b8affdf05f8c99d5832b5e939dac63dda2aea1bbfdb8c5598f0343acb07 |