Skip to main content

FastAPI-like decorators for Pyramid - Build type-safe REST APIs with automatic validation, serialization, and OpenAPI documentation.

Project description

pyramid-capstone

Release Build status codecov Commit activity License

FastAPI-like decorators for Pyramid - Build type-safe REST APIs with automatic validation, serialization, and OpenAPI documentation.

⚠️ Development Status Warning

This project is in early development (v0.1.x) and should NOT be used in production environments.

While we have comprehensive tests and the core functionality works, the API may change significantly between versions. Use at your own risk and expect breaking changes until we reach v1.0.0.

✨ 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.

🏃‍♂️ Quick Start

Installation

pip install pyramid-capstone

Basic Setup

from pyramid.config import Configurator
from pyramid_capstone import th_api

# Include the library in your Pyramid app
def main(global_config, **settings):
    config = Configurator(settings=settings)
    config.include('pyramid_capstone')
    
    # Scan for your decorated views
    config.scan()
    
    return config.make_wsgi_app()

🎯 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.

📚 Learn More

🤝 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyramid_capstone-0.1.1.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyramid_capstone-0.1.1-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file pyramid_capstone-0.1.1.tar.gz.

File metadata

  • Download URL: pyramid_capstone-0.1.1.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyramid_capstone-0.1.1.tar.gz
Algorithm Hash digest
SHA256 472edbc4adcdcd4ebafdda2039d24271882b8c68c4884f22ea7986813a3409e1
MD5 f5515dcbd9b8f371ad5776f5f979b5c2
BLAKE2b-256 7af8eda4471de931711abc860bf7582477f098540e2c744e667f6b0b8c35c2b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyramid_capstone-0.1.1.tar.gz:

Publisher: on-release-pypi.yml on tomascorrea/pyramid-capstone

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyramid_capstone-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pyramid_capstone-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c131f9858308ef1e2e0a1906b0eba8e57a0b8f3312defb40dbb4ed416a5e700
MD5 5fab05c2cd9e25c31ce7b21b38634ccc
BLAKE2b-256 8e0e9d4eb6f2378b64c131fd7a1135ad7171b6f2950bf747a2ea3aa09ca9a1e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyramid_capstone-0.1.1-py3-none-any.whl:

Publisher: on-release-pypi.yml on tomascorrea/pyramid-capstone

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page