pyramid-capstone¶
FastAPI-like decorators for Pyramid - Build type-safe REST APIs with automatic validation, serialization, and OpenAPI documentation.
โจ What is pyramid-capstone?¶
pyramid-capstone
enhances Pyramid's already excellent foundation with modern developer conveniences. Built on Pyramid's proven architecture of robustness, flexibility, and enterprise-grade security, it adds automatic validation, serialization, and documentation generation while preserving Pyramid's minimalist philosophy.
๐ฏ Key Features¶
- โก Developer Experience: Modern decorators with automatic validation and serialization
- ๐๏ธ Pyramid Foundation: Built on Pyramid's battle-tested, production-ready framework
- ๐ Seamless Integration: Works perfectly with existing Pyramid applications and middleware
- ๐ Auto Documentation: Automatic OpenAPI/Swagger documentation generation
- ๐ก๏ธ Enterprise Security: Leverages Pyramid's comprehensive security and authentication system
- ๐งช Production Ready: Comprehensive test suite built on Pyramid's reliability
๐ Quick Example¶
from pyramid.config import Configurator
from pyramid_capstone import th_api
@th_api.get('/users/{user_id}')
def get_user(request, user_id: int) -> dict:
return {"id": user_id, "name": "John Doe"}
@th_api.post('/users')
def create_user(request, name: str, email: str) -> dict:
# Parameters automatically extracted and validated from JSON body
return {"message": "User created", "name": name, "email": email}
# Pyramid app setup
def main(global_config, **settings):
config = Configurator(settings=settings)
config.include('pyramid_capstone')
config.scan()
return config.make_wsgi_app()
That's it! No manual schema definitions, no boilerplate validation code.
๐โโ๏ธ Getting Started¶
Ready to start building type-safe APIs? Check out our Getting Started Guide for installation instructions and your first API endpoint.
๐ Documentation¶
- Getting Started - Installation and basic setup
- Tutorial - Step-by-step guide with examples
- Security - Authentication and authorization
- API Reference - Complete API documentation
- Examples - Real-world examples and patterns
๐ฏ Why Choose pyramid-capstone?¶
pyramid-capstone combines Pyramid's enterprise-grade foundation with modern developer experience:
Feature | pyramid-capstone | Pure Pyramid | Pure Cornice |
---|---|---|---|
Developer Experience | โ Modern + Simple | โ Minimal | โ ๏ธ Schema-heavy |
Auto Validation | โ Type-hint based | โ Manual setup | โ Schema-based |
OpenAPI Docs | โ Auto-generated | โ Manual | โ ๏ธ Limited |
Production Readiness | โ Pyramid foundation | โ Battle-tested | โ Pyramid foundation |
Security & Auth | โ Full Pyramid power | โ Comprehensive | โ Full Pyramid power |
Flexibility | โ Pyramid's strength | โ Maximum | โ Pyramid's strength |
Learning Curve | โ Gentle enhancement | โ ๏ธ Framework mastery | โ ๏ธ Schema complexity |
The Best of Both Worlds: Get Pyramid's proven robustness, security, and flexibility with the convenience of automatic validation and documentation.
๐ค Contributing¶
We welcome contributions! Please see our Contributing Guide for details.
๐ License¶
This project is licensed under the MIT License - see the LICENSE file for details.