hn.today

Sqlthon – A lightweight Pythonic layer for SQLite

github.com7 points2 comments
Screenshot of Sqlthon – A lightweight Pythonic layer for SQLite

Sqlthon is a compact Python wrapper around SQLite3 that provides a more Pythonic API for defining schemas, inserting data, and querying a local SQLite database. It exposes a Connect context manager for opening databases, a Field object for building query conditions with standard Python operators, and a set of type/constraint keywords (e.g., INT, STR, PRIMARY_KEY, AUTO_INCREMENT, NOT_NULL, UNIQUE) to declare table columns. Installation is via pip and full usage docs are hosted on Read the Docs.

The repository contains a small codebase and documentation (docs, src/sqlthon, README, mkdocs configuration, and pyproject), with a history of 75 commits. Core operations shown in examples include add_table to define tables, add_record to stage rows, save_to_database to persist changes, and find_record to retrieve rows based on Field-based conditions. The project aims for simplicity and quick integration for projects that need lightweight SQLite access without a heavy ORM. Repository activity and community traction are minimal (one star, no forks), so users should review the docs and code for production readiness.

Read on github.com2 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

your C is not standard C

your C is not standard C

Standard C has many incompatibilities with how C is implemented in real-world compilers like gcc and clang, leading to non-conformance by default. These differences include handling of asm keywords, floating-point rounding modes, and support for standard pragmas, which are often ignored or unsupported by compilers. (sebsite.pw)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.