Skip to main content

A CLI framework based on asyncio

Project description

Latest PyPI version Latest Travis CI build status

A CLI framework based on asyncio.

Usage

The simplest usage is to just pass in an async function.

import asynccli


async def mycli():
    print("Hello, world.")


if __name__ == '__main__':
    app = asynccli.App(mycli)
    app.run()

It can also be instantiated as a class, as long it has a call method.

import asynccli


class DivisionCalculator(asynccli.CLI):
    numerator = asynccli.Integer(help_text='This is the numerator.')
    denominator = asynccli.Integer()

    async def call(self):
        print(self.first_num / self.second_num)


if __name__ == '__main__':
    app = asynccli.App(DivisionCalculator)
    app.run()

Installation

pip install asynccli

Requirements

Currently it requires Python 3.5 to make use of async/await

License

MIT

Authors

asynccli was written by Adam Hopkins. .

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

asynccli-0.1.0.tar.gz (3.0 kB view hashes)

Uploaded Source

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