make your project a cli too!
Project description
Starlette-cli: make your project a cli too!
This is a starlette-app that provides a CLI with a few basic Starlette commands, and which your other apps may extend.
Example
#!/usr/bin/env python3
import apps
project = apps.Project(
APPS=['starlette_cli']
)
app = project.starlette(
routes=[your_route...],
middleware=[Middleware(your_middleware...)]
)
if __name__ == '__main__':
project.apps['cli'].entry_point()
And your Starlette script becomes an extensible CLI.
Screenshots
Help & runserver command:
Dumping urls and middlewares:
Install
Install with::
pip install starlette-cli
Extend
Add a new command to the CLI with:
from starlette_cli import cli
@cli.cmd
def your_command(...):
"""Your documentation"""
Or, from within another starlette-app if you have one:
class YourApp(apps.App):
def setup(self):
self.project.apps['cli'].add(your_command)
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
starlette-cli-0.1.0.tar.gz
(2.7 kB
view hashes)