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.1.1.tar.gz
(10.1 kB
view hashes)