Skip to main content

Starlette Decorator Patching System, FastAPI style decorators

Project description

NitroDec

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

🚀 Overview

NitroDec is an Advanced Decorator For Starlette
Powered by NacDevs

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

🛠️ 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.1.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.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for nitrodec-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d34788a4617db56dcf3853e1404963a5bc9a0d36b2ff295527ebe2c540a15200
MD5 7bb6af196d3360d9e118b297ab4bdb01
BLAKE2b-256 dc52d7fc3c0bf0009e9dc5ecfef9db14421564fd38fc5bfa347e34fb34c805e2

See more details on using hashes here.

File details

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

File metadata

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

Hashes for nitrodec-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 681b1361c1e7f6227254f7cab61f0ffc6f58cbc115dd6e30728620926cee8293
MD5 2e1a67fe5045c7db14cd60b45d6ede1f
BLAKE2b-256 d539a04607a04b7c75afc381600e7d21ac34dbfe1c63cc0f847264fba3938b51

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