Pundra: Your FastAPI Companion for Productivity
FastAPI Pundra is a comprehensive toolkit that extends FastAPI with essential utilities, helpers, and integrations to accelerate your API development. Whether you're building REST APIs or GraphQL endpoints, Pundra provides the building blocks you need to create robust, scalable applications.
- 🚀 Zero Boilerplate: Auto-discover routes, automatic pagination, built-in exception handling
- 🔋 Batteries Included: Email system, JWT auth, GraphQL support, raw SQL utilities out of the box
- 📦 Production Ready: Battle-tested utilities for password hashing, validation, and error handling
- 🎯 Developer Experience: Write less code, focus on business logic, ship faster
- 🔧 Common Utilities: Password hashing, JWT auth, raw SQL support, helper functions
- 📧 Email System: Template-based emails, background tasks, mail templating with inline CSS
- 🌐 REST API: Auto router registration, exception handling, pagination, validation helpers
- 🍓 GraphQL (Strawberry): Common types, pagination, resolver utilities, validation integration
📖 Explore all features in detail →
Using pip:
pip install fastapi-pundraUsing uv (recommended for faster installation):
uv pip install fastapi-pundraOr add to your project:
uv add fastapi-pundrafrom fastapi import FastAPI
from fastapi_pundra.rest import auto_bind_router
from fastapi_pundra.rest.global_exception_handler import setup_exception_handlers
app = FastAPI()
# Setup global exception handling
setup_exception_handlers(app)
# Auto-discover and bind all API routes
router = APIRouter()
auto_bind_router(router, "app.api")
app.include_router(router)Project Structure:
app/
└── api/
├── health.py # → /health/*
└── v1/
├── users.py # → /v1/users/*
└── posts.py # → /v1/posts/*
📖 View complete tutorials and examples →
No more manual router imports! Pundra automatically discovers and registers all your API routes.
Send beautiful HTML emails with templates and background tasks using FastAPI's native BackgroundTasks.
Comprehensive utilities for both REST APIs and GraphQL (Strawberry) endpoints.
📖 See detailed examples and configuration →
🌐 Full Documentation Site ← Start here!
Quick Links:
- 📖 Documentation - Comprehensive guides and tutorials
- 🐛 Issues - Report bugs or request features
- 💡 Discussions - Ask questions and share ideas
- 🔗 LinkedIn - Follow for updates
- 📧 Email - Direct support
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
Mostafa Kamal (@code4mk)
- Email: [email protected]
- GitHub: github.com/code4mk
- LinkedIn: linkedin.com/in/code4mk
Built with these amazing tools:
- FastAPI - Modern, fast web framework for building APIs
- Strawberry GraphQL - Python GraphQL library