v1.0.0 LTS • 228 Tests Passing • 95% Coverage

Type-Safe PostgreSQL ORM
Using Pydantic Models

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!

Everything You Need

Production-ready features for modern Python applications.

🔗

Pydantic Integration

Define your database schema using Pydantic models. Full type validation and serialization.

Auto Table Creation

Tables are created and synchronized automatically. Add columns to your model and they're added to the database.

🚀

Async/Await Support

Full async support for all database operations. Non-blocking I/O for high-performance applications.

🔄

Connection Pooling

Built-in connection pooling automatically. Reuses connections for ~5x performance improvement.

🛡️

Type Safety

Full type hints and Pydantic validation. Catch errors at development time, not runtime.

📊

CRUD Operations

Simple insert, get, update, delete methods. Plus pagination, bulk operations, and transactions.

Stress Test Results

Validated under high-load conditions. 300,000 operations with 100% success rate. Async is 150x faster than Sync in production scenarios.

Async Mode (1,000 Users × 100 Blocks)
30,000ops/sec
Throughput
~5ms
Avg Latency
~10ms
P99
Sync Mode (Same Workload)
200ops/sec
Throughput
~15ms
Avg Latency
~30ms
P99

✓ 300,000 Operations Completed • 100% Success Rate • Async 150x Faster • View Full Report

Quick Start

Three ways to use wpostgresql - choose what fits your needs.

1

Basic CRUD

from wpostgresql import WPostgreSQL
db = WPostgreSQL(Model, config)
db.insert(record)
users = db.get_all()
2

Async Operations

await db.insert_async(rec)
users = await db.get_all_async()
3

Auto Pooling

# Pooling is automatic!
# Just use the library
db = WPostgreSQL(Model, config)

Install in Seconds

PyPI (Recommended)

pip install wpostgresql

From Source

# Clone and install
git clone https://github.com/wisrovi/wpostgresql
pip install -e .

Dev Dependencies

pip install -e ".[dev]"

Example Projects

Ready-to-use examples for every feature.

228
Tests Passing
95%
Code Coverage
14
Examples
300K+
Stress Ops
1.0.0
LTS Version
3.9+
Python
MIT
License

Author

WS

William Steve Rodriguez Villamizar

AI Leader & Solutions Architect

Building tools that make developers more productive. Creator of multiple open-source Python libraries for data processing and database operations.

Ready to Get Started?

Install wpostgresql and start building type-safe PostgreSQL applications in minutes.