Async cli application builder.
Project description
precept
Toolbox to create async command line applications.
Install
Install with pip: $ pip install precept
Usage
Basic:
from precept import CliApp, Command, Argument
class MyCli(CliApp):
"""
The name of the command will be the
Class docstring is added as cli description.
"""
@Command(Argument('argument', type=str))
async def my_command(self, argument):
print(argument)
def cli():
MyCli().start()
if __name__ == '__main__':
cli()
For local testing: Set entry_points.console_script
to my-cli = my_package.my_cli:cli
in setup.py
and $ pip install -e .
Then call: $ my-cli my-command hello
-> print hello
License
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
precept-0.2.0.tar.gz
(13.6 kB
view details)
File details
Details for the file precept-0.2.0.tar.gz
.
File metadata
- Download URL: precept-0.2.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f60ecd3804e892f1a5649339f9d116e8712f4b3a35808c469491ffe81abf5a2 |
|
MD5 | ab116653c488eafc0cbd294e5d6a719d |
|
BLAKE2b-256 | 6f50a8083153e8145b877d0adb9b3ba4559b2c48d3307eaf7444b59be0c027e6 |