A CLI framework based on asyncio
Project description
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
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)