Simple tool for creating CLI applications
Project description
argy
Argy is a simple tool for creating CLI programs using python, it tries to remove all the fuzz that comes with the standard library.
Usage
import argy
@argy
def add_numbers(x, y, subtract=False):
"""Adder of numbers
Just adds two numbers, nothing really special about it
:param x: The first number
:type x: int
:param y: The second number
:type y: int
:param subtract: Should we subtract instead?
:type subtract: bool
"""
if not subtract:
return x + y
else:
return x - y
This will create a CLI-program with the expected arguments, see also example.py
$ python example.py -h
usage: example.py [-h] [--subtract SUBTRACT] x y
positional arguments:
x The first number
y The second number
optional arguments:
-h, --help show this help message and exit
--subtract SUBTRACT Should we subtract instead?
Contributions
Contributions are welcome!
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
argy-0.0.2.tar.gz
(1.8 kB
view details)
File details
Details for the file argy-0.0.2.tar.gz
.
File metadata
- Download URL: argy-0.0.2.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 146a0498d78412ee12f671ceb69f20d432bbc958d8699c615d2ea31ff82060e0 |
|
MD5 | 5e825e92c2908c2a0e99f2dbb04d303a |
|
BLAKE2b-256 | b2a7e359664d5c6e0fee53037388bc77671bf522a8836253e71f2b6e12dddea3 |