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)
Metadata
Release files for starlette-cli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| starlette-cli-0.1.0.tar.gz | 2.7 kB | Details |
Release files / starlette-cli-0.1.0.tar.gz
| Download URL | starlette-cli-0.1.0.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9274a3222fe793509fb20874939d60207c2e5aff8005b8a0b39c8448c6996702
|
|
BLAKE2b-256 checksum How to use checksums |
627bb6e39ca141a048ca300643cb339987a274d4572bfd20fea13eb8beb0afbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|