Skip to main content

Light-weight pythonic db integration - powered by the best of all time: sqlite and pydantic

Project description

lythonic

PyPI version Documentation

Lythonic
Lightweight, reliable tools for database management and job scheduling in Python — built atop powerful industry standards: SQLite and Pydantic.

Lythonic helps you easily manage persistent data and scheduled tasks in your Python applications, no matter their size or complexity. It combines the trusted simplicity of SQLite (the world’s most used database) with Pydantic (the gold standard for data validation and modeling) to provide an effortless, modern development experience.

Why use lythonic?

  • Zero setup: No need to run a database server or learn new dialects. SQLite is embedded and self-contained.
  • Reliable models: Define your data models with clear type-checking, validation, and conversion using Pydantic.
  • Easy scheduling: Integrates simple, robust job/task scheduling primitives (coming soon) for recurring or deferred operations.
  • Pythonic APIs: Focus on productivity, safety, and clarity, following modern Python best practices throughout.

Quick Start for Developers

from pathlib import Path
from lythonic.state import DbModel, open_sqlite_db
from pydantic import Field

# Define your Pydantic-based model with automatic DDL generation
class Note(DbModel["Note"]):
    note_id: int = Field(default=-1, description="(PK) Unique identifier")
    content: str = Field(description="Note content")

# Create a new SQLite database or connect to existing:
db_path = Path("notes.db")
with open_sqlite_db(db_path) as conn:
    # Setup schema if it's new
    conn.execute(Note.create_ddl())
    conn.commit()

    # Insert a note
    n = Note(content="Hello world!")
    n.save(conn)   # Auto-assigns primary key
    conn.commit()

    # Query by id
    loaded = Note.load_by_id(conn, n.note_id)
    print(loaded.content)

You get:

  • Seamless storage and retrieval of strongly-typed Python objects.
  • No boilerplate: No need to hand-write SQL or adapters for most basic use.
  • Atomic, testable operations: See tabula_rasa_path and test files for utilities on prepping file/db state for clean test runs.

At a Glance

  • Models are defined as Pydantic classes — strict types, clear defaults, easy serialization.
  • Data is stored in local, portable .db files using SQLite.
  • Utilities for file and directory lifecycle, safe test/cleanup (see misc.py).
  • Test suite demonstrates end-to-end use: see /tests.
  • No heavy dependencies or servers; the whole stack is pure Python.

Suitable for scripts, data apps, bot backends, experiments, quick prototypes, or serious projects where simplicity and reliability win.

See project docs and modules for advanced usage and extension patterns.


Project Docs

For how to install uv and Python, see installation.md.

For development workflows, see development.md.

For instructions on publishing to PyPI, see publishing.md.

For documentation strategy and MkDocs setup, see documenting.md.


This project was built from simple-modern-uv.

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

lythonic-0.0.9.tar.gz (143.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lythonic-0.0.9-py3-none-any.whl (44.8 kB view details)

Uploaded Python 3

File details

Details for the file lythonic-0.0.9.tar.gz.

File metadata

  • Download URL: lythonic-0.0.9.tar.gz
  • Upload date:
  • Size: 143.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.13

File hashes

Hashes for lythonic-0.0.9.tar.gz
Algorithm Hash digest
SHA256 dee7c6f4607b140a61190873ca0b605860de3f17ddaf0aa05c5c0e5f5bb4fe62
MD5 9693c35364d2d4c3797a77a67d895837
BLAKE2b-256 a29c58fd81fd1464b6b95bb6c7878996497247240400aa12cef8822e379dcf86

See more details on using hashes here.

File details

Details for the file lythonic-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: lythonic-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 44.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.13

File hashes

Hashes for lythonic-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 975a872a75db6291f6549d3ba4e0cb1d33e07de8a0e6278e6be0f9d7de0c1f0a
MD5 89ff37a726eb1614151509bdefa9b5cc
BLAKE2b-256 abf2d07acddc7f3b8351e0de0606d84532d9e602c25129d55f52ac1d3614a668

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