Skip to main content

Python Web Framework for building web applications with ease

Project description

PyPinnacle

PyPinnacle is a powerful and flexible Python framework for building web applications quickly and efficiently.

purpose

PyPI - Version

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

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

pypinnacle-0.1.3.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file pypinnacle-0.1.3.tar.gz.

File metadata

  • Download URL: pypinnacle-0.1.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for pypinnacle-0.1.3.tar.gz
Algorithm Hash digest
SHA256 42174e6101455f642669c25a0c6c112d9eab883c2ec64224ba3afcb202e16e31
MD5 d7a99625f69d4d5c28bf681a4031e31a
BLAKE2b-256 45f6c7033469631cca22b4aa98448233018a4acb145383024c0e6e25c7a162fa

See more details on using hashes here.

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