Pydantic models and JSON helpers for presentation timing format, shared across projects
Project description
presenter-json
Pydantic models and JSON helpers for presentation timing format — a shared library for the various projects that read and generate these JSON files (training data, playback, benchmarking, …).
The JSON shape resembles the ProPresenter /v1/presentation/{uuid} API response,
with extra metadata on presentation.id (audio source, timing method, file
version) and per-slide timing lists (trigger time, start time, stop time).
Any ProPresenter field not explicitly modelled passes through untouched.
Install
pip install presenter-json
Or with Poetry, as a path/develop dependency from a sibling project:
[tool.poetry.dependencies]
presenter-json = { path = "../presenter-json", develop = true }
Reading a file
from presenter_json import load_presentation, cues, slide_texts
pres = load_presentation("sermon.json")
print(pres.presentation.id.name)
print(slide_texts(pres)) # text of every slide, flattened
for cue in cues(pres): # sorted playback cues
print(f"{cue.time:7.3f} [{cue.group_name}] {cue.text}")
Generating a file
from presenter_json import (
new_presentation, add_group, add_slide,
set_trigger_times, set_metadata, save_presentation,
)
pres = new_presentation(name="My Song", audio_path="audio/my-song.wav")
set_metadata(pres, method="model", method_description="forced alignment", version="1.0")
verse = add_group(pres, "Verse 1")
s1 = add_slide(verse, "First line of the verse")
set_trigger_times(s1, [0.0])
add_slide(verse, "Second line") # untriggered — no timing written
save_presentation(pres, "my-song.json")
API overview
IO (presenter_json.io)
load_presentation(path)/loads_presentation(text)→PresentationFilesave_presentation(model, path)/dumps_presentation(model)load_raw(path)→ unvalidateddict
Reading (presenter_json.helpers)
iter_groups,iter_slides,group_name,slide_text,slide_texts,slide_fieldget_trigger_times/get_start_times/get_stop_times/get_timingdetect_timing_key,cues(sortedCuelist)
Generating / mutating
new_presentation,add_group,add_slideset_trigger_times/set_start_times/set_stop_times/set_timing,clear_timingset_metadata,from_api_response
Models (presenter_json.models)
PresentationFile,Presentation,PresentationId,Group,Slide- Constants:
METHOD_MANUAL,METHOD_CAPTIONS,METHOD_MODEL,TRIGGER_TIME_KEY, …
Development
poetry install
poetry run pytest
Tests run in GitHub Actions across Python 3.11–3.13 (.github/workflows/ci.yml).
Tagging a release (vX.Y.Z) publishes to PyPI via Trusted Publishing
(.github/workflows/publish.yml).
All changes go through a branch off main and land via pull request.
Project details
Release history Release notifications | RSS feed
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 presenter_json-0.1.0.tar.gz.
File metadata
- Download URL: presenter_json-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1da0dc2eb4f9a622c05c5e1079fa6ddaf382325d072e893c2c8442d1e4b9a48b
|
|
| MD5 |
a90a27c03156f5b61c6b517f0daf2821
|
|
| BLAKE2b-256 |
9101154c010def706e65a1ca9e84b98e72ed8bbdea06e905c1ac44f3e21f4bd1
|
Provenance
The following attestation bundles were made for presenter_json-0.1.0.tar.gz:
Publisher:
publish.yml on scaperothian/presenter-json
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
presenter_json-0.1.0.tar.gz -
Subject digest:
1da0dc2eb4f9a622c05c5e1079fa6ddaf382325d072e893c2c8442d1e4b9a48b - Sigstore transparency entry: 2043447421
- Sigstore integration time:
-
Permalink:
scaperothian/presenter-json@6a7d428daccca80af264d4902064174a870832e1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/scaperothian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6a7d428daccca80af264d4902064174a870832e1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file presenter_json-0.1.0-py3-none-any.whl.
File metadata
- Download URL: presenter_json-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
321e8d7ad24afdfc4196ce48db682f49bbf944e47cbb2e9dc85d1b1ed899a3dd
|
|
| MD5 |
c6ccdea195d4900cd9c1fdf527bc03d2
|
|
| BLAKE2b-256 |
65363dffe77356beb24154984ca21ba2a0c2f050767ec3c81a14625017c9405c
|
Provenance
The following attestation bundles were made for presenter_json-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on scaperothian/presenter-json
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
presenter_json-0.1.0-py3-none-any.whl -
Subject digest:
321e8d7ad24afdfc4196ce48db682f49bbf944e47cbb2e9dc85d1b1ed899a3dd - Sigstore transparency entry: 2043447508
- Sigstore integration time:
-
Permalink:
scaperothian/presenter-json@6a7d428daccca80af264d4902064174a870832e1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/scaperothian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6a7d428daccca80af264d4902064174a870832e1 -
Trigger Event:
push
-
Statement type: