Skip to main content

Async cli application builder.

Project description

precept

CircleCI Coverage Status PyPI version LICENSE Downloads

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

MIT license

Project details


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.0.tar.gz (9.2 kB view details)

Uploaded Source

File details

Details for the file precept-0.1.0.tar.gz.

File metadata

  • Download URL: precept-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for precept-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7f1cb66718984262e081e5fe38f4dbbe6999df40342fdebf6dcb35045fdba0c5
MD5 a22983ed28d9d65db534b7d0c58f47d1
BLAKE2b-256 f2cbfb008eaef03e096f2ee8caaabc6f5602f887286e126d4bac17110042e8f3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page