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.10.tar.gz (204.0 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.10-py3-none-any.whl (58.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lythonic-0.0.10.tar.gz
Algorithm Hash digest
SHA256 06bab8e81a3f0cc438b8b1eb7dca2095180e4319a6346390b670fe9986a65d04
MD5 c8356867ae26c94c845ca417e5fd2ee8
BLAKE2b-256 cf974d12428aae6054acb3f4410bff43679b9669de0054b4e8223f582780c637

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for lythonic-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 be2c40be81c172d8dd31862083fc6a37190fa117975bb7362e3da2897aa909e5
MD5 35bbde61cf7b858e59d41db329cd0e5e
BLAKE2b-256 8144f78d1f2afb28392c8c1856ea7bf702332cec3d4a79bb0a3ef53b282650f2

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