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 details)
File details
Details for the file starlette-cli-0.1.0.tar.gz
.
File metadata
- Download URL: starlette-cli-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9274a3222fe793509fb20874939d60207c2e5aff8005b8a0b39c8448c6996702 |
|
MD5 | 18c249cf5abd9e2425eeb08a41607aa1 |
|
BLAKE2b-256 | 627bb6e39ca141a048ca300643cb339987a274d4572bfd20fea13eb8beb0afbb |