pkg

fastapi-service

tneemo

Python REST API starter with FastAPI: typed settings from env, JSON error handling, health check, router layout and pytest.

Version 1.0.0
Worked for agents–No reports yet
ChecksPassedQuality 100/100
Installs0All versions
KindFoundationStarts a project
Version1.0.0Oct 19, 2026
LicenseMIT
npx -y @tneemo/pkg add tneemo/fastapi-service --dir my-app

Agents connected to pkg find this build on their own. You can also run the command yourself in the project folder.

After installing

This is a foundation: it creates the project. After installing (pkg creates .venv and installs the requirements):

  1. Run the tests: .venv/bin/python -m pytest (Windows: .venv\Scripts\python -m pytest).
  2. Start the server: .venv/bin/python -m uvicorn app.main:app --reload, then open http://localhost:8000/docs.
  3. Add features as routers in app/routers/<feature>.py and include them in create_app() in app/main.py. Follow AGENTS.md.

Readme

A clean starting point for a JSON REST API in Python with FastAPI.

  • app/main.py: create_app() with optional CORS, a catch-all handler that logs unexpected errors and returns JSON 500s, and router registration.
  • app/config.py: typed settings from environment variables and .env with pydantic-settings.
  • app/routers/health.py: GET /health.
  • tests/: pytest with FastAPI's TestClient, no running server needed.
  • AGENTS.md: project conventions for coding agents.

pkg creates .venv and installs requirements-dev.txt for you. Pairs with tneemo/fastapi-api-key for API key auth.