Plinx Web Framework¶
Welcome to the official documentation for Plinx, a simple, lightweight, and educational Python web framework and ORM.
About Plinx¶
Plinx is an experimental web framework designed with the following goals:
- Simplicity: Clean API with minimal magic
- Educational Value: Clear implementation for learning purposes
- Minimalism: Small core with few dependencies
- Extensibility: Easy to customize and extend
- Python 3.11+: Taking advantage of modern Python features
Plinx is both a functional web framework for building simple applications and an educational tool for learning how web frameworks and ORMs work under the hood.
Key Features¶
Web Framework¶
- Route Decorators: Simple URL routing with path parameters
- Request/Response Model: Clean separation of concerns
- Class-Based Views: Support for HTTP method-specific handlers
- Middleware System: For global request/response processing
- WSGI Compatibility: Works with standard WSGI servers
ORM (Object-Relational Mapping)¶
- Simple Table Definitions: Define tables as Python classes
- SQLite Support: Lightweight database integration
- Basic CRUD Operations: Create, read, update, delete
- Relationships: Support for foreign key relationships
- Type Mapping: Python types to SQLite types
Quick Example¶
from plinx import Plinx
app = Plinx()
@app.route("/")
def home(request, response):
response.text = "Hello, World!"
@app.route("/hello/{name}")
def hello(request, response, name):
response.json = {"message": f"Hello, {name}!"}
if __name__ == "__main__":
# For development only
from wsgiref.simple_server import make_server
server = make_server('localhost', 8000, app)
print("Server running at http://localhost:8000")
server.serve_forever()
Getting Started¶
- Installation: How to install Plinx
- Quick Start: Create your first Plinx application
User Guide¶
- Core Concepts: Fundamental concepts and design
- Routing: URL routing and parameter handling
- Middleware: Request and response processing
- Handling Requests: Working with request data
- Responses: Generating HTTP responses
- Class-Based Views: Using classes for route handlers
- Error Handling: Managing and customizing errors
ORM Guide¶
- ORM Introduction: Getting started with the ORM
- Tables & Models: Defining database tables
- Database Operations: Working with data
API Reference¶
- Applications: Core application class
- Methods: HTTP method decorators
- Middleware: Middleware system
- Response: HTTP response handling
- ORM: Database interaction
Development¶
- Contributing: How to contribute to Plinx
- Design Philosophy: Principles and tradeoffs
About¶
- Release Notes: What's new in 1.0.1
- License: MIT License information
Who Should Use Plinx?¶
- Learners: Those interested in understanding web framework internals
- Teachers: For educational demonstrations of web concepts
- Developers: Building simple applications or prototypes
- Contributors: Interested in evolving a minimalist framework
Plinx may not be suitable for large-scale applications with complex requirements. It is intentionally minimalistic and focused on clarity rather than comprehensive features.
Thank you for using Plinx! We hope you find it both useful and educational.