Decorator For Starlette, FastAPI style Decorators
Project description
DecoStar
Letest Version: 1.1
Developer: @Nactire
Git Repo: DecoStar
🚀 Overview
DecoStar is an Advanced Decorator For Starlette,
Supports Sync And Async Both def Functions.
⚡ Key Features
• Easy To Use
• Auto Execute After import “patch_starlette_app()”
• Use DecoStar And Boost Your Coding Speed
• Lightweight And Super Fast
🎲 Supported HTTP Methods
- GET, POST, PUT
- PATCH, DELETE, OPTIONS
- HEAD, TRACE
🛠️ System Requirements
- Python 3.8+
🌊 Module installation
pip install DecoStar --break-system-packages
🧭 Usage Examples
Async Example
from starlette.applications import Starlette
import DecoStar
app = Starlette()
@app.get("/")
async def home(request):
return {"message": "Hello World"}
Sync Example
import DecoStar
from starlette.applications import Starlette
app = Starlette()
@app.get("/sync")
def sync_route(request):
return {"message": "This is a sync function, auto-wrapped by DecoStar"}
Post Route With Data
from starlette.requests import Request
from starlette.responses import JSONResponse
import DecoStar
from starlette.applications import Starlette
app = Starlette()
@app.post("/echo")
async def echo(request: Request):
data = await request.json()
return {"you_sent": data}
Multiple Http Methods (Same Route)
import DecoStar
from starlette.applications import Starlette
from starlette.requests import Request
app = Starlette()
@app.get("/multi")
@app.post("/multi")
async def multi_method(request: Request):
return {"method_used": request.method}
Start Example Using Uvicorn
# 𝘍𝘰𝘳 𝘢𝘱𝘱.𝘱𝘺 𝘞𝘪𝘵𝘩 𝘢𝘱𝘱 𝘝𝘢𝘳𝘪𝘢𝘣𝘭𝘦.
uvicorn app:app --reload
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file decostar-1.1.tar.gz.
File metadata
- Download URL: decostar-1.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b0627bf5e233cdf40ef28e01d55d710afbb87eb1d4f46f6dc6c36f41e96aaf6
|
|
| MD5 |
d47524647b9364f77d7f104bdedcdce6
|
|
| BLAKE2b-256 |
9ba6a148e66a0ac2a1397ebee9ee35cd04bdd8f492154dbe56f4f56466e11715
|
File details
Details for the file decostar-1.1-py3-none-any.whl.
File metadata
- Download URL: decostar-1.1-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd90ca26209c3a9c3962f01951653aa346fd2c41874e3434e4af87e4700791c1
|
|
| MD5 |
8700566a0741d9edf546b18ae6561ce5
|
|
| BLAKE2b-256 |
6e642a9e9872e7a30927dcf6ab57af9bf614f1b9f3e9c28cf71080cc6bd53b2e
|