Run you apps as server. A start/stop/status commandline for your ASGI/WSGI compatible frameworks.
Project description
Allows you to start/stop/restart ASGI/WSGI servers as daemons without needing to know any commandline arguments or using screen. Add the following to your flask/fastapi service.
if __name__ == "__main__":
UvicornDaemonite(
name="my_app",
description="Does do canonic pythionic things.",
port="6969",
log_level="info").start()
name has to be the same as the name of your main file. The rest should be self explanatory.
After adding und making your my_app.py executable type:
./my_app.py
for more info about parameters.
Full FastAPI example
The following code has to be in a file main.py, the Daemonite name has to be main in this case.:
#!/usr/bin/python
from fastapi import FastAPI
from uvicorn_daemonite import Daemonite
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
if __name__ == "__main__":
Daemonite(
name="main",
description="Does do canonic pythionic things.",
port="6969",
log_level="info").start()
Future
I might add code so that info shows memory utilization.
Warning
I know nothing about python, and I think its a pile of dung as a language. Has some nice libraries though, so I have to make life bearable for myself. The code in this lib might be very bad or unideomatic. Deal with it.
License
LGPL 3.0 or later
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
File details
Details for the file uvicorn_daemonite-0.1.1.tar.gz.
File metadata
- Download URL: uvicorn_daemonite-0.1.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2cb60ac78bc1a87fddbfc37ae8928876ea7a22b917eb61e254fcc6c5a96e401
|
|
| MD5 |
587bc2fb0fe29b8ef7bf0bc54ddf71aa
|
|
| BLAKE2b-256 |
881d90b03538ebb809a7d3a5ee6e0c3a533a13333fe52049b1e536c429d7b21e
|