$npx skillfedfor your agent

fastapi-decorators

Create decorators for your endpoints using FastAPI dependencies.

Worth itPyPI Software DevelopmentReleased Mar 2026148.7K downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — fastapi_decorators-1.0.20-py3-none-any.whl
v1.0.20 · released 2026-03-30 · Python >=3.8 · 1 runtime deps: fastapi

Yes. The package solves a genuine friction point in FastAPI: building reusable decorators that need access to dependencies. It has no security vulnerabilities, low install friction, permissive licensing, and active maintenance. Use it when you find yourself writing the same dependency-aware decorator logic across multiple endpoints.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction: pure Python wheel with a single runtime dependency on fastapi.
  • Actively maintained with recent commits and a stable beta status.

License · maintenance · safety

permissive license (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

last release 2026-03-30 (137 days) · last repo commit 2026-03-30 · 83 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 148,668 downloads/mo, #11,023 on PyPI

Verify before relying

from fastapi import FastAPI, Depends, HTTPException
from fastapi_decorators import depends

@depends
def require_auth(token: str = Depends(lambda: "token")):
    if not token:
        raise HTTPException(status_code=401)

app = FastAPI()

@app.get("/items")
@require_auth
def get_items():
    return {"items": []}
  • Whether the package handles async endpoint functions and async dependencies correctly in all decorator patterns.
  • Performance overhead of the @depends decorator wrapper compared to direct FastAPI Depends() usage at scale.
Same gist for agents: .md · .json

What it is and what it does

fastapi-decorators provides a @depends decorator that wraps FastAPI's Depends() mechanism, letting you build reusable decorators that inject dependencies into endpoints without repeating dependency resolution logic. Instead of manually threading FastAPI dependencies through custom decorators, you annotate a function with @depends and use it directly as a decorator on your route handlers.

The package supports three main patterns: simple decorators that run side effects (logging, auditing), decorator factories that accept parameters (rate limiting, authorization scopes), and wrapper decorators that intercept endpoint execution while still accessing injected dependencies (caching, error handling). It integrates directly with FastAPI's dependency system, so decorated endpoints appear correctly in auto-generated API documentation.

Use it for

  • Build an authentication decorator that checks OAuth2 tokens and raises 401/403 errors without duplicating token resolution logic across routes.
  • Create a rate-limiting decorator factory that accepts max_calls and period parameters and applies them to individual endpoints.
  • Implement a caching decorator that wraps expensive operations and uses a Depends()-injected cache backend to store and retrieve results.
  • Add request logging or audit trails by decorating endpoints to capture request metadata and write to a database via injected Session.
  • Enforce custom response headers or modify responses by decorating endpoints with a decorator that receives the Response object via Depends().

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

The package solves a genuine friction point in FastAPI: building reusable decorators that need access to dependencies. It has no security vulnerabilities, low install friction, permissive licensing, and active maintenance. Use it when you find yourself writing the same dependency-aware decorator logic across multiple endpoints.

Install

fastapi-decorators on PyPI

Before you install

Low friction: pure Python wheel with a single runtime dependency on fastapi. Actively maintained with recent commits and a stable beta status.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

from fastapi import FastAPI, Depends, HTTPException
from fastapi_decorators import depends

@depends
def require_auth(token: str = Depends(lambda: "token")):
    if not token:
        raise HTTPException(status_code=401)

app = FastAPI()

@app.get("/items")
@require_auth
def get_items():
    return {"items": []}

Verify before relying

  • Whether the package handles async endpoint functions and async dependencies correctly in all decorator patterns.
  • Performance overhead of the @depends decorator wrapper compared to direct FastAPI Depends() usage at scale.

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
fastapi
MaintenanceActively maintained 137 days since the last release
Last repo commit
First released
Downloads148,668 / month, #11,023 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaEnvironment :: Web EnvironmentFramework :: FastAPIIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: InternetTopic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: HTTP ServersTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Evidence: fastapi_decorators-1.0.20-py3-none-any.whl

Tags

Capabilities
fastapi decorator with dependenciesfastapi depends decoratorreusable fastapi endpoint decoratorsfastapi dependency injection decoratorsfastapi decorator factoryfastapi middleware-like decorators
Topics
fastapi-extensiondecorator-patterndependency-injection
PyPI keywords
decoratorsdependenciesdependencyfastapimiddleware

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “fastapi decorator with dependencies”

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also fast-depends · fastapi-injectable · fastapi-versioning · fastapi-cache2 · decorator · fastapi-limiter · uncalled-for · essentials · slowapi · fan-tools