Simple and powerful PostgreSQL ORM for Python. Define your schema with Pydantic, and wpostgresql handles the rest. Auto table creation, async support, and built-in connection pooling.
# Install pip install wpostgresql # Define your model from pydantic import BaseModel from wpostgresql import WPostgreSQL class User(BaseModel): id: int name: str email: str # Create database - table auto-created! db = WPostgreSQL(User, db_config) db.insert(User(id=1, name="John", email="john@example.com")) users = db.get_all() # Done!
Production-ready features for modern Python applications.
Define your database schema using Pydantic models. Full type validation and serialization.
Tables are created and synchronized automatically. Add columns to your model and they're added to the database.
Full async support for all database operations. Non-blocking I/O for high-performance applications.
Built-in connection pooling automatically. Reuses connections for ~5x performance improvement.
Full type hints and Pydantic validation. Catch errors at development time, not runtime.
Simple insert, get, update, delete methods. Plus pagination, bulk operations, and transactions.
Validated under high-load conditions. 300,000 operations with 100% success rate. Async is 150x faster than Sync in production scenarios.
✓ 300,000 Operations Completed • 100% Success Rate • Async 150x Faster • View Full Report
Three ways to use wpostgresql - choose what fits your needs.
from wpostgresql import WPostgreSQL db = WPostgreSQL(Model, config) db.insert(record) users = db.get_all()
await db.insert_async(rec) users = await db.get_all_async()
# Pooling is automatic! # Just use the library db = WPostgreSQL(Model, config)
pip install wpostgresql
# Clone and install
git clone https://github.com/wisrovi/wpostgresql
pip install -e .
pip install -e ".[dev]"
Ready-to-use examples for every feature.
Install wpostgresql and start building type-safe PostgreSQL applications in minutes.