Skip to main content

Async cli application builder.

Project description

precept

CircleCI Documentation Status Coverage Status PyPI version LICENSE Downloads

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 to my-cli = my_package.my_cli:cli in setup.py
  • Install locally: $ pip install -e .
  • Then call: $ my-cli my-command hello -> print hello

Full documentation

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

Uploaded Source

File details

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

File metadata

  • Download URL: precept-0.6.6.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for precept-0.6.6.tar.gz
Algorithm Hash digest
SHA256 976c906e7bcfea2eec335c7ec3e7fc294c688020ddefc5efcd0d49a94c18e77a
MD5 4641837c80d777b879d61b8b453ef755
BLAKE2b-256 a24aec092190a2d7593c8a175c55ea0cf6b000a6d74dcea9cefddc6604792f4f

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