wsqlite

SQLite ORM using Pydantic models - Simple, type-safe, high-performance SQLite operations

PyPI Version Python Versions License Test Coverage Read the Docs

Key Features

  • Pydantic Integration - Define database schemas using Pydantic v2 models

  • Auto Table Creation - Tables are created and synchronized automatically with model changes

  • Connection Pooling - High-performance thread-safe connection pool with WAL mode

  • Async Support - Full async/await for high-performance applications

  • Type Safety - Full type hints and Pydantic validation

  • SQL Injection Prevention - Built-in identifier validation

Quick Start

from pydantic import BaseModel
from wsqlite import WSQLite

# Define your model
class User(BaseModel):
    id: int
    name: str
    email: str

# Create database
db = WSQLite(User, "database.db")

# Insert data
db.insert(User(id=1, name="John", email="john@example.com"))

# Query data
users = db.get_all()
john = db.get_by_field(name="John")

Performance

Metric

Value

Operations/second

~5,000+

Average latency

~0.2ms

Memory overhead

<10MB

Installation

pip install wsqlite

For development with all tools:

pip install wsqlite[dev]

Why wsqlite?

  • Zero Configuration - Works out of the box with sensible defaults

  • Type Safe - Leverage Pydantic’s validation for your data

  • Production Ready - Connection pooling, WAL mode, and comprehensive error handling

  • Well Tested - 300+ unit tests with 79% code coverage

License

MIT License - See LICENSE for details.


Author: William Steve Rodriguez Villamizar
GitHub: wisrovi
LinkedIn: wisrovi-rodriguez