Async cli application builder.
Project description
precept
Async application framework.
Install
Install with pip: $ pip install precept
Usage
Basic:
from precept import Precept, Command, Argument
class MyCli(Precept):
"""
The name of the application will be the spinal-case version of
the name of the class.
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
tomy-cli = my_package.my_cli:cli
insetup.py
- Install locally:
$ pip install -e .
- Then call:
$ my-cli my-command hello
-> printhello
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.6.2.tar.gz
(18.7 kB
view details)
File details
Details for the file precept-0.6.2.tar.gz
.
File metadata
- Download URL: precept-0.6.2.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d58be9406eb1ec7dcc32d95abbed12be1285bb8d3ff5de626338c1f228ae091a |
|
MD5 | 746038152f583f8bed545f4fa0e0f6b8 |
|
BLAKE2b-256 | 214da0b0b9fb2a85e37728a4ba19075f0ecfdc5cce544fe37a04b0cc10397858 |