hearing.storage

Transcript persistence via key-value stores (python-storage / dol).

A transcript is standoff annotation data — persist the whole transcript (not just a rolling window) so post-meeting agents see everything (see the hearing-agents and annotation-systems skills). MeetingStore saves/loads transcripts as JSON keyed by meeting id, over any MutableMapping — a plain dict (tests), a dol store (e.g. TextFiles), or the dependency-free filesystem fallback here.

Functions

get_store([path])

Return a string-valued MutableMapping for transcripts.

transcript_from_json(s)

Reconstruct a Transcript from transcript_to_json() output.

transcript_to_json(transcript)

Serialize a Transcript to a JSON string (round-trippable).

Classes

MeetingStore([store])

Save/load transcripts keyed by meeting id, over any text MutableMapping.

class hearing.storage.MeetingStore(store=None)[source]

Bases: object

Save/load transcripts keyed by meeting id, over any text MutableMapping.

>>> store = MeetingStore({})                       # in-memory
>>> from hearing.types import Transcript, TranscriptSegment, TimeSpan
>>> _ = store.save("m1", Transcript([TranscriptSegment("hi", TimeSpan(0, 500))]))
>>> store.load("m1").text
'hi'
>>> list(store)
['m1']
load(meeting_id)[source]

Load the transcript stored under meeting_id.

Return type:

Transcript

meeting_ids()[source]

Sorted ids of stored meetings.

Return type:

list[str]

save(meeting_id, transcript)[source]

Persist transcript under meeting_id; return the storage key.

Return type:

str

hearing.storage.get_store(path=None)[source]

Return a string-valued MutableMapping for transcripts.

None -> an in-memory dict. A path -> a dol.TextFiles store if dol is installed (pip install 'hearing[storage]'), else the dependency-free _FileTextStore over that directory.

Return type:

MutableMapping

hearing.storage.transcript_from_json(s)[source]

Reconstruct a Transcript from transcript_to_json() output.

Return type:

Transcript

hearing.storage.transcript_to_json(transcript)[source]

Serialize a Transcript to a JSON string (round-trippable).

Return type:

str