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.4.tar.gz
(20.5 kB
view details)
File details
Details for the file precept-0.6.4.tar.gz
.
File metadata
- Download URL: precept-0.6.4.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 362ab876462a76f29f566dbb9ea07b181035c92540ba93d7896ab1d2f77ef9d9 |
|
MD5 | 663212b54b9f65f0326b634e2bcd9bac |
|
BLAKE2b-256 | 630d01fcb1a952566691ba4f226a50806626ffaf8a5f9e170c411dbe8fcbd1a1 |