Files
catena/crates/bindings/python/catena/__init__.py
T
funkpower 0416359c65 bindings: colophon's own question, and the reply folded back in
colophon has composed the question about what its pages did not settle
since it was written, and merged a reply back into the record it read.
Both were reachable only from a terminal, so a pipeline wanting the same
fallback would have had to write its own prompt — a second one, drifting
from the first, asking for a shape merge does not accept.

merge fills only the unsettled fields, so a model cannot overwrite what a
book printed about itself. That is the property that makes asking one
safe, and it belongs to colophon rather than to any caller.
2026-09-21 10:49:51 -04:00

94 lines
1.9 KiB
Python

"""The catena libraries, in process.
Every function here is the same code the command-line tool runs, and hands
back the same record shapes it writes to stdout — dictionaries rather than
lines of JSON.
>>> import catena
>>> chunks = catena.chunk_markdown(markdown, target=512)
>>> chunks[0]["page"]
41
"""
from ._catena import (
__version__,
canonical_subject,
chunk_markdown,
citation_prompt,
clean_record,
colophon_prompt,
clean_underscores,
compose_subjects,
count_tokens,
cue_windows,
fetch_identifier,
find_citations,
fuse_hits,
identify,
is_shouting,
isbn_from_filename,
isbn_from_text,
looks_like_footnote_citations,
looks_like_person,
merge_citation_reply,
merge_colophon,
needs_subject,
pack_cues,
parse_identifier,
parse_subtitles,
read_colophon,
record_problems,
record_severity,
same_work,
scrub,
segment_cues,
series_of,
shelve,
split_collection,
suggest_author,
title_case,
title_in_author,
valid_isbn,
)
__all__ = [
"__version__",
"canonical_subject",
"chunk_markdown",
"citation_prompt",
"clean_record",
"colophon_prompt",
"clean_underscores",
"compose_subjects",
"count_tokens",
"cue_windows",
"fetch_identifier",
"find_citations",
"fuse_hits",
"identify",
"is_shouting",
"isbn_from_filename",
"isbn_from_text",
"looks_like_footnote_citations",
"looks_like_person",
"merge_citation_reply",
"merge_colophon",
"needs_subject",
"pack_cues",
"parse_identifier",
"parse_subtitles",
"read_colophon",
"record_problems",
"record_severity",
"same_work",
"scrub",
"segment_cues",
"series_of",
"shelve",
"split_collection",
"suggest_author",
"title_case",
"title_in_author",
"valid_isbn",
]