PyPinnacle
PyPinnacle is a powerful and flexible Python framework for building web applications quickly and efficiently.
Table of Contents
Features
- Simple and intuitive API
- Built-in support for common web functionalities
- Highly extensible and customizable
- Lightweight and fast
- Comprehensive documentation
Installation
You can install PyPinnacle using pip:
pip install pypinnacle
Basic usage:
from pypinnacle.app import PyPinnacle
app = PyPinnacle()
@app.route('/')
def home():
return 'Hello, World!'
@app.route("/hello/{name}")
def hello(request, response, name):
response.text = f"Hello {name}"
@app.route("/books")
class Books:
def get(self, request, response):
response.text = "Books Page"
def post(self, request, response):
response.text = "Endpoint to create a book"
@app.route("/template")
def template_handler(request, response):
response.body = app.template(
"home.html",
context={"title": "PyPinnacle", "body": "This is a template"},
)
response.content_type = "text/html"
@app.route("/json")
def json_handler(request, response):
response_data = {"name": "PyPinnacle", "language": "Python"}
response.body = json.dumps(response_data).encode()
response.content_type = "application/json"
@app.route("/text")
def text_handler(request, response):
response.text = "This is a plain text"
Add middleware
from pypinnacel.middleware import Middleware
from pypinnacle.app import PyPinnacle
app = PyPinnacle()
class LogMiddleware(Middleware):
def process_request(self, request):
print("Processing request", request.url)
def process_response(self, request, response):
print("Processing response", request.url)
app.add_middleware(LogMiddleware) # add middleware
Metadata
Release files for pypinnacle 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pypinnacle-0.1.3.tar.gz | 5.3 kB | Details |
Release files / pypinnacle-0.1.3.tar.gz
| Download URL | pypinnacle-0.1.3.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
42174e6101455f642669c25a0c6c112d9eab883c2ec64224ba3afcb202e16e31
|
|
BLAKE2b-256 checksum How to use checksums |
45f6c7033469631cca22b4aa98448233018a4acb145383024c0e6e25c7a162fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.12
|