Skip to main content

Decorator For Starlette, FastAPI style Decorators

Project description

NitroDec

Letest Version: 0.1.3
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

nitrodec-0.1.3.tar.gz (2.8 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.3-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for nitrodec-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ba21e413a02d56f438db5124e17cfcadf976e243a3bf18bca4f3f1c677377049
MD5 bfd0e459583fdbfc0d1e9b64d1c02ebf
BLAKE2b-256 d8344d37dd15a96fbe6d3b9218a0a4c329d0f938dadf264d442e5f9f99879aa6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nitrodec-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5173e99804a97f2f0b9ee0f479702e16c9b9d219084daf0c68730d3d187535f6
MD5 78964e0fb1c7f1f380dd7209e5385d30
BLAKE2b-256 43952dac741833d41906ff2aa70085ac368e0a5452bbb9a98b4db6816ae8429e

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