Vault
The vault: plain files on disk are the source of truth.
Layout::
<vault>/
<folder>/<sub-folder>/<recording-id>/
meta.json title, tags, tracks, active transcript
mic.flac, system.flac, ... 16 kHz mono tracks
transcript.<name>.json one file per transcription pass
.murmurvault/index.db derived search index; rebuild with `reindex`
Folders are real directories, so the vault can be browsed, backed up or grepped without the tool.
Recording
dataclass
¶
Metadata of one recording, stored as meta.json in its directory.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Unique id, also the directory name. |
title |
str
|
Human-readable title. |
created |
str
|
ISO timestamp of creation. |
folder |
str
|
Folder path relative to the vault root; |
tags |
list[str]
|
Sorted, normalised tags. |
tracks |
dict[str, str]
|
Track name to file name inside the recording directory. |
track_offsets |
dict[str, float]
|
Track name to start offset in seconds relative to the recording start. |
duration |
float
|
Length in seconds. |
source |
str
|
|
active_transcript |
str | None
|
Name of the transcript pass shown by default. |
path |
Path
|
Directory holding the recording's files (not serialised). |
Source code in src/murmurvault/vault.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
to_dict()
¶
Serialise to the JSON-compatible content of meta.json.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The metadata without the in-memory |
Source code in src/murmurvault/vault.py
145 146 147 148 149 150 151 152 153 | |
Segment
dataclass
¶
A timed piece of transcript.
Attributes:
| Name | Type | Description |
|---|---|---|
start |
float
|
Start time in seconds from the start of the recording. |
end |
float
|
End time in seconds. |
text |
str
|
Transcribed text. |
speaker |
str | None
|
Speaker label, e.g. |
track |
str | None
|
Name of the track the segment came from. |
Source code in src/murmurvault/vault.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
Transcript
dataclass
¶
One transcription pass over a recording.
Attributes:
| Name | Type | Description |
|---|---|---|
engine |
str
|
Name of the engine that produced it. |
model |
str
|
Model used by the engine. |
segments |
list[Segment]
|
Segments sorted by start time. |
language |
str | None
|
Language passed to the engine, if any. |
created |
str
|
ISO timestamp of the pass. |
Source code in src/murmurvault/vault.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
from_dict(data)
classmethod
¶
Build a transcript from :meth:to_dict output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any]
|
Plain data as written to |
required |
Returns:
| Type | Description |
|---|---|
Transcript
|
The transcript. |
Source code in src/murmurvault/vault.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
text(timestamps=True)
¶
Render as plain text, one segment per line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timestamps
|
bool
|
Prefix each line with its start time. |
True
|
Returns:
| Type | Description |
|---|---|
str
|
The rendered transcript. |
Source code in src/murmurvault/vault.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
to_dict()
¶
Serialise to a JSON-compatible dict.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The transcript as plain data. |
Source code in src/murmurvault/vault.py
71 72 73 74 75 76 77 | |
Vault
¶
A directory tree of recordings.
Source code in src/murmurvault/vault.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | |
__init__(root)
¶
Open the vault at root, creating it if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str | Path
|
Vault directory. |
required |
Source code in src/murmurvault/vault.py
214 215 216 217 218 219 220 221 222 223 | |
delete(rec)
¶
Delete a recording's directory and prune folders left empty.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rec
|
Recording
|
The recording to delete. |
required |
Source code in src/murmurvault/vault.py
363 364 365 366 367 368 369 370 | |
folders()
¶
List the folders that hold recordings.
Returns:
| Type | Description |
|---|---|
list[str]
|
Sorted folder paths, excluding the root. |
Source code in src/murmurvault/vault.py
323 324 325 326 327 328 329 | |
get(ref)
¶
Look up a recording by id or unique id prefix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ref
|
str
|
Full id or a prefix of it. |
required |
Returns:
| Type | Description |
|---|---|
Recording
|
The recording. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If nothing matches or the prefix is ambiguous. |
Source code in src/murmurvault/vault.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
load_transcript(rec, name=None)
staticmethod
¶
Read a transcription pass.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rec
|
Recording
|
The recording. |
required |
name
|
str | None
|
Pass name; defaults to the active one. |
None
|
Returns:
| Type | Description |
|---|---|
Transcript | None
|
The transcript, or None if there is none. |
Source code in src/murmurvault/vault.py
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | |
move(rec, folder)
¶
Move a recording to another folder, pruning folders left empty.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rec
|
Recording
|
The recording to move. |
required |
folder
|
str
|
Destination folder; |
required |
Returns:
| Type | Description |
|---|---|
Recording
|
The updated recording. |
Source code in src/murmurvault/vault.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | |
new_recording(title='', folder='', tags=None, source='record')
¶
Create an empty recording directory with its meta.json.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Title; defaults to one derived from the current time. |
''
|
folder
|
str
|
Folder path inside the vault. |
''
|
tags
|
list[str] | None
|
Initial tags. |
None
|
source
|
str
|
|
'record'
|
Returns:
| Type | Description |
|---|---|
Recording
|
The new recording. |
Source code in src/murmurvault/vault.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
recordings(folder=None, tags=None)
¶
List recordings, newest first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder
|
str | None
|
Only recordings in this folder or below it. |
None
|
tags
|
list[str] | None
|
Only recordings carrying all of these tags. |
None
|
Returns:
| Type | Description |
|---|---|
list[Recording]
|
The matching recordings. |
Source code in src/murmurvault/vault.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
save(rec)
¶
Write meta.json atomically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rec
|
Recording
|
The recording to save. |
required |
Source code in src/murmurvault/vault.py
257 258 259 260 261 262 263 264 265 | |
save_transcript(rec, name, transcript, activate=True)
¶
Write a transcription pass, optionally making it the active one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rec
|
Recording
|
The recording. |
required |
name
|
str
|
Pass name, used in the file name. |
required |
transcript
|
Transcript
|
The transcript to write. |
required |
activate
|
bool
|
Make it the transcript shown and indexed by default. |
True
|
Source code in src/murmurvault/vault.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 | |
set_tags(rec, add=(), remove=())
¶
Add and remove tags, then save.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rec
|
Recording
|
The recording to change. |
required |
add
|
Iterable[str]
|
Tags to add. |
()
|
remove
|
Iterable[str]
|
Tags to remove. |
()
|
Returns:
| Type | Description |
|---|---|
Recording
|
The updated recording. |
Source code in src/murmurvault/vault.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | |
tags()
¶
Count recordings per tag.
Returns:
| Type | Description |
|---|---|
dict[str, int]
|
Tag to number of recordings, sorted by tag. |
Source code in src/murmurvault/vault.py
331 332 333 334 335 336 337 338 339 340 341 | |
transcript_names(rec)
staticmethod
¶
List the transcription passes stored for a recording.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rec
|
Recording
|
The recording. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
Sorted pass names. |
Source code in src/murmurvault/vault.py
395 396 397 398 399 400 401 402 403 404 405 | |
fmt_time(seconds)
¶
Format seconds as MM:SS, or H:MM:SS from one hour on.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
seconds
|
float
|
Time in seconds; negative values are clamped to zero. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The formatted time. |
Source code in src/murmurvault/vault.py
156 157 158 159 160 161 162 163 164 165 166 167 168 | |
normalize_folder(folder)
¶
Return a clean relative folder path, rejecting anything that escapes the vault.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder
|
str
|
Folder path such as |
required |
Returns:
| Type | Description |
|---|---|
str
|
The normalised path, |
Raises:
| Type | Description |
|---|---|
ValueError
|
If a component is |
Source code in src/murmurvault/vault.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
normalize_tag(tag)
¶
Normalise a tag: strip a leading # and lower-case it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
str
|
The tag as typed. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The normalised tag. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the tag is empty or contains whitespace or commas. |
Source code in src/murmurvault/vault.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |