Skip to main content

Decorator For Starlette, FastAPI style Decorators

Project description

NitroDec

Letest Version: 0.1.2
Developer: @Nactire
Git Repo: NitroExpose

🚀 Overview

NitroDec is an Advanced Decorator For Starlette,
Supports Sync And Async Both def Functions.

⚡ Key Features

• Easy To Use
• Automatically Patch After import
• 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

nitrodec-0.1.2.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nitrodec-0.1.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file nitrodec-0.1.2.tar.gz.

File metadata

  • Download URL: nitrodec-0.1.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nitrodec-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3e3cfbcaa65f33a80a96dc2c1d94272421306df4d7d973c67e549cbeb0aa11fd
MD5 54d9cb2259f4d6c391c2d44daf705835
BLAKE2b-256 6c9285bd637c0037a2bce681c3942b28b384381dd0cb11998291a15566a57f1b

See more details on using hashes here.

File details

Details for the file nitrodec-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: nitrodec-0.1.2-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

Hashes for nitrodec-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 48bf695934b8802bcd647f20b8a9eaa6e86fb2131ba76c2e76989a5e828d4598
MD5 c75881f9b708424bda34fd6782028225
BLAKE2b-256 e2a97aedea503a7e1eaee2b490d4813f9954355eda1488a194e6194cecacf6e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page