Skip to main content

Starlette Decorator Patching System, FastAPI style decorators

Project description

NitroDec

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

🚀 Overview

NitroDec is an Advanced Decorator For Starlette inspired by FastAPI Style Decorators
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 NitroExpose --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.0.tar.gz (2.7 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.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nitrodec-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 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.0.tar.gz
Algorithm Hash digest
SHA256 5cc1a92432cdf54a1d701f449c0b76223dd64eb1520bd1a8dcd9c6666d480ea3
MD5 6fa63ee6c813fd1b57d47ccdf5030d83
BLAKE2b-256 6fbf8b09f152b1da84fe25a21b2c2158d4a0f6de10b1dc0b3e7ea4d78c5413b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nitrodec-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c3119cc4c69e4a064166996ea308cc861ea69651be9adcef0f886261669da78
MD5 a1b169e0d2c2919aba1bc48a30253a1a
BLAKE2b-256 22413a36c66f2918fb734cb97f2d9bb744063bd65244b33b76fe9fcdd8e2cd25

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