Booksmart's book-ingestion pipeline: parsing, structure, extraction, summaries, embeddings — as durable Stage functions consumers drive with their own Runner.
Project description
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")
Search
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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file booksmart_core-0.3.0.tar.gz.
File metadata
- Download URL: booksmart_core-0.3.0.tar.gz
- Upload date:
- Size: 38.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b3e7ff74addcb9f80b94ddf9db723279f6625ddd023184b5810e9e40f4b4592
|
|
| MD5 |
45eca86737e4d6838d51f306d649bdd6
|
|
| BLAKE2b-256 |
36aff202e8a42da486a9840cb3eb15a188d60e6f987615bff7e4d39d963b390f
|
Provenance
The following attestation bundles were made for booksmart_core-0.3.0.tar.gz:
Publisher:
publish.yml on dworznik/booksmart
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
booksmart_core-0.3.0.tar.gz -
Subject digest:
3b3e7ff74addcb9f80b94ddf9db723279f6625ddd023184b5810e9e40f4b4592 - Sigstore transparency entry: 2211285569
- Sigstore integration time:
-
Permalink:
dworznik/booksmart@b014131af1ce8f903bb7c7286eebb0f0c1112489 -
Branch / Tag:
refs/tags/core-v0.3.0 - Owner: https://github.com/dworznik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b014131af1ce8f903bb7c7286eebb0f0c1112489 -
Trigger Event:
push
-
Statement type:
File details
Details for the file booksmart_core-0.3.0-py3-none-any.whl.
File metadata
- Download URL: booksmart_core-0.3.0-py3-none-any.whl
- Upload date:
- Size: 48.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bee1b3c4fbab72f7c06825b8af8f51b361f718a481e19606ec42fe4907faae1
|
|
| MD5 |
29f67a72c632caccd1eb405397bb4e98
|
|
| BLAKE2b-256 |
755bdfa8dca9ed6909899af6555d319747bcefa1531860dca259c9ce7654f99c
|
Provenance
The following attestation bundles were made for booksmart_core-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on dworznik/booksmart
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
booksmart_core-0.3.0-py3-none-any.whl -
Subject digest:
1bee1b3c4fbab72f7c06825b8af8f51b361f718a481e19606ec42fe4907faae1 - Sigstore transparency entry: 2211285592
- Sigstore integration time:
-
Permalink:
dworznik/booksmart@b014131af1ce8f903bb7c7286eebb0f0c1112489 -
Branch / Tag:
refs/tags/core-v0.3.0 - Owner: https://github.com/dworznik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b014131af1ce8f903bb7c7286eebb0f0c1112489 -
Trigger Event:
push
-
Statement type: