Skip to main content

booksmart-core

Booksmart's book-ingestion pipeline as a typed library: parsing, structure detection, profile generation, knowledge extraction, summaries, and embeddings — exposed as durable, synchronous Stage functions that a consumer drives with its own Runner (see ADR 0002).

Core owns the domain: the ORM models, a single dialect-neutral Alembic history (SQLite and Postgres), object storage, the provider abstractions (Anthropic / OpenAI / Gemini, plus deterministic fakes), and the Qdrant vector store. It reads no environment at all — a consumer constructs Settings explicitly (API keys included; since 0.2.0 there is no env-var fallback) and owns engine and session lifecycle.

Consumers:

  • booksmart — the local CLI (SQLite, embedded Qdrant).
from booksmart_core.database import create_engine, upgrade_to_head
from booksmart_core.runner import execute_run

upgrade_to_head(url)
run_id = execute_run(session_factory, storage_root, book_id, "full")

booksmart_core.search.search is the read side of the embedding pipeline, and the single seam every consumer's search surface sits on — the CLI's search command calls it against embedded Qdrant; a server consumer would call it with the same arguments against a served instance.

from booksmart_core.search import search

results = search(session, vector_store, embedder, "how do deep modules help?", limit=5)
for hit in results.hits:
    print(hit.score, hit.title)
print(results.embedding_tokens)  # what the query cost; None if the provider withheld it

It embeds the query with the collection's locked model (refusing a mismatch, ADR 0001), ANN-searches Qdrant, and resolves each hit back to its detached ORM row. A search is one unbatched embedding call, so embedding_tokens is the only place a consumer costing search traffic can get that number.

Metadata

Release files for booksmart-core 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for booksmart-core 0.3.1
File Size Uploaded Provenance Actions
booksmart_core-0.3.1.tar.gz 38.7 kB With provenance Details for booksmart_core-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for booksmart-core 0.3.1
File Interpreter ABI Platform Actions
booksmart_core-0.3.1-py3-none-any.whl Python 3 none any Details for booksmart_core-0.3.1-py3-none-any.whl

Total release size: 87.3 kB

Release files / booksmart_core-0.3.1.tar.gz

Download URL booksmart_core-0.3.1.tar.gz
Size 38.7 kB
Tags Source
SHA-256 checksum
How to use checksums
32021093114ac2d6df0032768ab6176c7c129c613a40f9b20215f1dc0a41c915
BLAKE2b-256 checksum
How to use checksums
ef0ec1b3fecc17cb1c5ff1a42683ec94d5b959b719bbada1b2b7238096853d6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.

Transparency log

Release files / booksmart_core-0.3.1-py3-none-any.whl

Download URL booksmart_core-0.3.1-py3-none-any.whl
Size 48.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0191ca87596bd465eb793b1aacfc4bf9363640bc5963c04f0b70ac5d58625a8
BLAKE2b-256 checksum
How to use checksums
4b33bd5aa44e6251b1cd44a4a1a04bac36027a612d7cfa0c3aee6fede58256bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.

Transparency log

Security for booksmart-core 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for booksmart_core-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page