Decorator For Starlette, FastAPI style Decorators
Project description
NitroDec
Letest Version: 0.1.4
Developer: @Nactire
Git Repo: NitroDec
🚀 Overview
NitroDec 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 NitroDec 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+
- Ubuntu Or Debian Recommended
🌊 Module installation
pip install NitroDec --break-system-packages
🧭 Usage Examples
Async Example
from starlette.applications import Starlette
import NitroDec
app = Starlette()
@app.get("/")
async def home(request):
return {"message": "Hello World"}
Sync Example
import NitroDec
from starlette.applications import Starlette
app = Starlette()
@app.get("/sync")
def sync_route(request):
return {"message": "This is a sync function, auto-wrapped by NitroDec"}
Post Route With Data
from starlette.requests import Request
from starlette.responses import JSONResponse
import NitroDec
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 NitroDec
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
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 nitrodec-0.1.4.tar.gz.
File metadata
- Download URL: nitrodec-0.1.4.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 |
6480eb883bd2c1b5cda056fa02c7b68f4da3fe09697470d9567893c8dc0563bf
|
|
| MD5 |
237b50d387f32907df7f5c4d1d970559
|
|
| BLAKE2b-256 |
42ba42e91a6d3535a5acc8e542e0f43b9d6d644b98c36a0cafed45d066cac3a6
|
File details
Details for the file nitrodec-0.1.4-py3-none-any.whl.
File metadata
- Download URL: nitrodec-0.1.4-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 |
af7f32fe6a2fc57c769e731dab0253e10fb838746f32d1da8912225c22e73911
|
|
| MD5 |
3329f87fa23ac5bf47cd05b81dee7646
|
|
| BLAKE2b-256 |
ec0ba9abade806642880fd0a26363abdafbb823df68e5bff058165c76e6dd75d
|