FastAPI-like decorators for Pyramid - Build type-safe REST APIs with automatic validation, serialization, and OpenAPI documentation.
Project description
pyramid-capstone
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.
- 📖 Documentation: https://tomas_correa.github.io/pyramid-capstone/
- 🔧 Source Code: https://github.com/tomas_correa/pyramid-capstone/
- 🐍 PyPI: <https://pypi.org/project/pyramid-capstone/
✨ What is pyramid-capstone?
pyramid-capstone brings the developer experience of FastAPI to the Pyramid web framework. Write clean, type-safe API endpoints with automatic request validation, response serialization, and OpenAPI documentation generation.
🎯 Key Features
- 🔒 Type Safety: Full type hint support with automatic validation
- ⚡ Zero Boilerplate: Minimal code, maximum functionality
- 🔗 Pyramid Integration: Works seamlessly with existing Pyramid applications
- 📚 Auto Documentation: Automatic OpenAPI/Swagger documentation
- 🛡️ Security Ready: Built-in support for Pyramid's security system
- 🧪 Well Tested: Comprehensive test suite with high coverage
🚀 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?
| Feature | pyramid-capstone | Pure Pyramid | Pure Cornice |
|---|---|---|---|
| Type Safety | ✅ Built-in | ❌ Manual | ❌ Manual |
| Auto Validation | ✅ Automatic | ❌ Manual | ⚠️ Schema required |
| OpenAPI Docs | ✅ Generated | ❌ Manual | ⚠️ Limited |
| Boilerplate | ✅ Minimal | ❌ Verbose | ⚠️ Medium |
| Learning Curve | ✅ Gentle | ⚠️ Steep | ⚠️ Medium |
📚 Learn More
- 📖 Full Documentation - Complete guides and API reference
- 🚀 Getting Started - Step-by-step tutorial
- 💡 Examples - Complete blog API example with advanced features
- 🔒 Security Guide - Authentication and authorization
🤝 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyramid_capstone-0.1.0.tar.gz.
File metadata
- Download URL: pyramid_capstone-0.1.0.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7708ed2bd74b2c1a6142caeca41042d48ca654daa25aa2d1f1c682e57b855cdb
|
|
| MD5 |
2f45e30b7a693ada7fb63d4f4567ceb9
|
|
| BLAKE2b-256 |
e04f1673718a8f54550fea28e2e55a1433af8d7bf215e17fdc0d819b579a1eb5
|
Provenance
The following attestation bundles were made for pyramid_capstone-0.1.0.tar.gz:
Publisher:
on-release-pypi.yml on tomascorrea/pyramid-capstone
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyramid_capstone-0.1.0.tar.gz -
Subject digest:
7708ed2bd74b2c1a6142caeca41042d48ca654daa25aa2d1f1c682e57b855cdb - Sigstore transparency entry: 428403898
- Sigstore integration time:
-
Permalink:
tomascorrea/pyramid-capstone@323f11b337941400797ae42eec0acf6a9fc2ddd5 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/tomascorrea
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
on-release-pypi.yml@323f11b337941400797ae42eec0acf6a9fc2ddd5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyramid_capstone-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyramid_capstone-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27bf36d5cb96cc90add8a75eee824ab6f2eb64a64bb2201f8a0a5bb4b244f9e6
|
|
| MD5 |
ec26b044cf06ae9a68e3c20e5282a812
|
|
| BLAKE2b-256 |
3e332b113b12dca00ffacf6a60e131b95b3852c15b0b0bef1f709035c1b2e4d4
|
Provenance
The following attestation bundles were made for pyramid_capstone-0.1.0-py3-none-any.whl:
Publisher:
on-release-pypi.yml on tomascorrea/pyramid-capstone
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyramid_capstone-0.1.0-py3-none-any.whl -
Subject digest:
27bf36d5cb96cc90add8a75eee824ab6f2eb64a64bb2201f8a0a5bb4b244f9e6 - Sigstore transparency entry: 428403911
- Sigstore integration time:
-
Permalink:
tomascorrea/pyramid-capstone@323f11b337941400797ae42eec0acf6a9fc2ddd5 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/tomascorrea
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
on-release-pypi.yml@323f11b337941400797ae42eec0acf6a9fc2ddd5 -
Trigger Event:
release
-
Statement type: