python-fastapi
Python FastAPI development with uv package manager, modular project structure, SQLAlchemy ORM, and production-ready patterns.
Install / Use
npx skills add aiskillstore/marketplace --skill python-fastapiInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Data & AnalyticsSupported Platforms
Our assessment of python-fastapi
python-fastapi scores 91/100 on our quality scale, 208th of 601 Data & Analytics skills we index (top 35%).
Its SKILL.md is 17 KB long, well organised into 41 sections with 19 code examples: a thorough specification that gives an agent plenty to work with.
It has 428 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so python-fastapi is actively maintained.
- Our last check on 2026-10-29 found the source still online.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit ā read the skill file before letting an agent act on it.
Safety scan
ReviewOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands (1 minor note below). An AI review judged it risky: Line 94 instructs `curl -LsSf https://astral.sh/uv/install.sh | sh`, which tells the agent to pipe a remote installer script directly into a shell.
- noteInstalls by piping a downloaded script into a shellline 94
curl -LsSf https://astral.sh/uv/install.sh | sh
AI review: risky
- Line 94 instructs `curl -LsSf https://astral.sh/uv/install.sh | sh`, which tells the agent to pipe a remote installer script directly into a shell.
- This is a skill/rules file (SKILL.md), so commands it instructs the agent to execute are relevant to its risk classification.
- Other commands use the legitimate `uv` package manager normally; the only elevated-risk behavior is the remote pipe-to-shell installation.
AI review by kimi-k2.7-code on 2026-10-08. Automated pattern scan on 2026-10-08. It catches known dangerous patterns, not every risk ā read a skill before letting an agent act on it.
python-fastapi compared with similar skills
All 4 of these similar skills score higher than python-fastapi; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| python-fastapi (this skill)by aiskillstore | 91 | 428 | 55d ago | SKILL.md |
| claude-memby thedotmack | 100 | 118.2k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 113.0k | 10d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 80.1k | today | CLAUDE.md |
| Claude-Code-Game-Studiosby Donchitos | 100 | 40.1k | 9d ago | CLAUDE.md |
Frequently asked questions
- How do I install python-fastapi?
- Run
npx skills add aiskillstore/marketplace --skill python-fastapi. The install tabs above show the steps for each supported agent. - Which AI agents does python-fastapi work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is python-fastapi safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands (1 minor note below). An AI review judged it risky: Line 94 instructs
curl -LsSf https://astral.sh/uv/install.sh | sh, which tells the agent to pipe a remote installer script directly into a shell. It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand. - Is python-fastapi still maintained?
- The repository was last updated about 2 months ago, so python-fastapi is actively maintained.
Skill content
View source on GitHubname: python-fastapi description: Python FastAPI development with uv package manager, modular project structure, SQLAlchemy ORM, and production-ready patterns. alwaysApply: false
Python FastAPI Development
Expert patterns for building Python APIs with FastAPI, uv package manager, modular architecture, and SQLAlchemy database integration.
Technology Stack
- Runtime: Python 3.12+
- Package Manager: uv (fast, Rust-based)
- Framework: FastAPI
- ORM: SQLAlchemy 2.0 (async)
- Validation: Pydantic v2
- Database: PostgreSQL (or SQLite for dev)
- Migrations: Alembic
- Testing: pytest, pytest-asyncio
- Linting: ruff
Project Structure
Feature-based modular architecture - code organized by domain, not by layer:
my-project/
āāā pyproject.toml # Project config with uv
āāā uv.lock # Lock file
āāā .python-version # Python version
āāā .env # Environment variables
āāā .env.example
āāā alembic.ini # Alembic config
āāā alembic/ # Migrations
ā āāā env.py
ā āāā script.py.mako
ā āāā versions/
āāā src/
ā āāā app/
ā āāā __init__.py
ā āāā main.py # FastAPI app entry
ā āāā config.py # Settings
ā āāā database.py # DB session
ā āāā core/
ā ā āāā __init__.py
ā ā āāā dependencies.py # Shared dependencies
ā ā āāā exceptions.py # Custom exceptions
ā ā āāā middleware.py # Middleware
ā ā āāā security.py # Auth utilities
ā āāā models/
ā ā āāā __init__.py
ā ā āāā base.py # SQLAlchemy base & mixins
ā āāā features/
ā ā āāā __init__.py
ā ā āāā auth/
ā ā ā āāā __init__.py
ā ā ā āāā api.py # Auth endpoints
ā ā ā āāā schemas.py # Auth Pydantic schemas
ā ā ā āāā services.py # Auth business logic
ā ā ā āāā models.py # Auth SQLAlchemy models
ā ā ā āāā utils.py # Auth helpers (JWT, etc.)
ā ā āāā users/
ā ā ā āāā __init__.py
ā ā ā āāā api.py # User endpoints
ā ā ā āāā schemas.py # User Pydantic schemas
ā ā ā āāā services.py # User business logic
ā ā ā āāā models.py # User SQLAlchemy models
ā ā ā āāā repository.py # User data access
ā ā āāā items/
ā ā āāā __init__.py
ā ā āāā api.py
ā ā āāā schemas.py
ā ā āāā services.py
ā ā āāā models.py
ā āāā api/
ā āāā __init__.py
ā āāā router.py # Aggregates all feature routers
āāā tests/
āāā __init__.py
āāā conftest.py
āāā features/
ā āāā auth/
ā ā āāā test_auth.py
ā āāā users/
ā āāā test_users.py
āāā integration/
Quick Setup with uv
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create new project
uv init my-project
cd my-project
# Set Python version
uv python pin 3.12
# Add dependencies
uv add fastapi uvicorn[standard] sqlalchemy[asyncio] asyncpg
uv add pydantic pydantic-settings python-dotenv
uv add alembic
# Add dev dependencies
uv add --dev pytest pytest-asyncio pytest-cov httpx ruff mypy
# Create source structure
mkdir -p src/app/{api/v1/endpoints,core,models,schemas,services,repositories}
touch src/app/__init__.py
Core Patterns
pyproject.toml
[project]
name = "my-project"
version = "0.1.0"
description = "FastAPI application"
requires-python = ">=3.12"
dependencies = [
"fastapi>=0.115.0",
"uvicorn[standard]>=0.32.0",
"sqlalchemy[asyncio]>=2.0.0",
"asyncpg>=0.30.0",
"pydantic>=2.10.0",
"pydantic-settings>=2.6.0",
"python-dotenv>=1.0.0",
"alembic>=1.14.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-asyncio>=0.24.0",
"pytest-cov>=6.0.0",
"httpx>=0.28.0",
"ruff>=0.8.0",
"mypy>=1.13.0",
]
[tool.ruff]
target-version = "py312"
line-length = 88
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP", "B", "C4", "SIM"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
[tool.mypy]
python_version = "3.12"
strict = true
Configuration (src/app/config.py)
from functools import lru_cache
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
case_sensitive=False,
)
# App
app_name: str = "My API"
debug: bool = False
api_v1_prefix: str = "/api/v1"
# Database
database_url: str = "postgresql+asyncpg://user:pass@localhost:5432/db"
# Security
secret_key: str = "change-me-in-production"
access_token_expire_minutes: int = 30
@lru_cache
def get_settings() -> Settings:
return Settings()
settings = get_settings()
Database Setup (src/app/database.py)
from collections.abc import AsyncGenerator
from sqlalchemy.ext.asyncio import (
AsyncSession,
async_sessionmaker,
create_async_engine,
)
from app.config import settings
engine = create_async_engine(
settings.database_url,
echo=settings.debug,
pool_pre_ping=True,
)
async_session_maker = async_sessionmaker(
engine,
class_=AsyncSession,
expire_on_commit=False,
)
async def get_db() -> AsyncGenerator[AsyncSession, None]:
async with async_session_maker() as session:
try:
yield session
await session.commit()
except Exception:
await session.rollback()
raise
SQLAlchemy Base Model (src/app/models/base.py)
from datetime import datetime
from sqlalchemy import DateTime, func
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
class Base(DeclarativeBase):
pass
class TimestampMixin:
created_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True),
server_default=func.now(),
)
updated_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True),
server_default=func.now(),
onupdate=func.now(),
)
Feature Module Pattern
Each feature is self-contained with its own api, schemas, services, models, and utils.
Feature: users/schemas.py
from pydantic import BaseModel, EmailStr, ConfigDict
class UserBase(BaseModel):
email: EmailStr
full_name: str | None = None
class UserCreate(UserBase):
password: str
class UserUpdate(BaseModel):
email: EmailStr | None = None
full_name: str | None = None
password: str | None = None
class UserResponse(UserBase):
model_config = ConfigDict(from_attributes=True)
id: int
is_active: bool
Feature: users/models.py
from sqlalchemy import String
from sqlalchemy.orm import Mapped, mapped_column
from app.models.base import Base, TimestampMixin
class User(Base, TimestampMixin):
__tablename__ = "users"
id: Mapped[int] = mapped_column(primary_key=True)
email: Mapped[str] = mapped_column(String(255), unique=True, index=True)
hashed_password: Mapped[str] = mapped_column(String(255))
full_name: Mapped[str | None] = mapped_column(String(255))
is_active: Mapped[bool] = mapped_column(default=True)
Feature: users/repository.py
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from app.features.users.models import User
class UserRepository:
def __init__(self, db: AsyncSession):
self.db = db
async def get(self, id: int) -> User | None:
result = await self.db.execute(select(User).where(User.id == id))
return result.scalar_one_or_none()
async def get_by_email(self, email: str) -> User | None:
result = await self.db.execute(select(User).where(User.email == email))
return result.scalar_one_or_none()
async def get_all(self, skip: int = 0, limit: int = 100) -> list[User]:
result = await self.db.execute(select(User).offset(skip).limit(limit))
return list(result.scalars().all())
async def create(self, data: dict) -> User:
user = User(**data)
self.db.add(user)
await self.db.flush()
await self.db.refresh(user)
return user
async def update(self, user: User, data: dict) -> User:
for field, value in data.items():
if value is not None:
setattr(user, field, value)
await self.db.flush()
await self.db.refresh(user)
return user
Feature: users/services.py
from sqlalchemy.ext.asyncio import AsyncSession
from app.core.security import hash_password
from app.features.users.models import User
from app.features.users.repository import UserRepository
from app.features.users.schemas import UserCreate, UserUpdate
class UserService:
def __init__(self, db: AsyncSession):
self.db = db
self.repo = UserRepository(db)
async def get(self, user_id: int) -> User | None:
return await self.repo.get(user_id)
async def get_by_email(self, email: str) -> User | None:
return await self.repo.get_by_email(email)
async def list(self, skip: int = 0, limit: int = 100) -> list[User]:
return await self.repo.get_all(skip=skip, limit=limit)
async def create(self, user_in: UserCreate) -> User:
data = user_in.model_dump()
data["hashed_password"] = hash_password(data.pop("password"))
return await self.repo.create(data)
async def update(self, user: User, user_in: UserUpdate) -> User:
data = user_in.model_dump(exclude_unset=True)
if "password" in data:
data["hashed_password"] = hash_password(data.pop("password"))
return await self.repo.update(user, data)
Feature: users/api.py
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.ext.asyncio import AsyncSession
from app.database import get_db
from app.features.users.schemas import UserCreate, UserResponse, UserUpdate
from app.features.users.services import UserService
router = APIRouter(prefix="/users", tags=["users"])
def get_service(db: AsyncSession = Depends(get_db)) -> UserService:
return UserService(db)
@router.get("", response_model=list[UserResponse])
async def list_users(
skip: int = 0,
limit: int = 100,
service: UserService = Depends(get_service),
):
return await service.list(skip=skip, limit=limit)
@router.get("/{user_id}", response_model=UserResponse)
async def get_user(
user_id: int,
service: UserService = Depends(get_service),
):
user = await service.get(user_id)
if not user:
raise HTTPException(status_code=404, detail="User not found")
return user
@router.post("", response_model=UserResponse, status_code=status.HTTP_201_CREATED)
async def create_user(
user_in: UserCreate,
service: UserService = Depends(get_service),
):
if await service.get_by_email(user_in.email):
raise HTTPException(status_code=400, detail="Email already registered")
return await service.create(user_in)
@router.patch("/{user_id}", response_model=UserResponse)
async def update_user(
user_id: int,
user_in: UserUpdate,
service: UserService = Depends(get_service),
):
user = await service.get(user_id)
if not user:
raise HTTPException(status_code=404, detail="User not found")
return await service.update(user, user_in)
Feature: users/init.py (exports)
from app.features.users.api import router
from app.features.users.models import User
from app.features.users.schemas import UserCreate, UserResponse, UserUpdate
from app.features.users.services import UserService
__all__ = ["router", "User", "UserCreate", "UserResponse", "UserUpdate", "UserService"]
Main Router (src/app/api/router.py)
from fasta
Truncated for display ā read the full file on GitHub.
Related Skills
claude-mem
118.2kPersistent Context Across Sessions for Every Agent ā Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
113.0kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu ā one CLI, zero API fees.
headroom
80.1kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Claude-Code-Game-Studios
40.1kTurn Claude Code into a full game dev studio ā 49 AI agents, 75 workflow skills, and a complete coordination system mirroring real studio hierarchy.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit ā see the Safety scan above for what the skill file itself contains.
