Skip to content

pyramid-capstone

Release Build status codecov License

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

๐ŸŽฏ 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.