tituli.tools¶
The SSOT of dispatchable operations: flat, JSON-able in, JSON-able out.
These are the functions every surface projects: the CLI (python -m tituli)
today, an MCP server or HTTP route tomorrow, an agent skill in prose. Nothing
here imports a surface library; each function takes paths and strings, writes
a file, and returns a dict describing what it wrote.
>>> sorted(f.__name__ for f in _dispatch_funcs)
['calligram', 'caption', 'credits', 'fonts', 'lower_third', 'overlay_video', 'title_card']
Functions
|
Lay |
|
Put a museum-label caption and a tiny attribution on |
|
Render credits from a JSON spec file (or JSON string) to |
|
List installed font families (optionally filtered by substring). |
|
A name + role block, bottom-left, as a transparent overlay (or on a picture). |
|
Composite captions/lower thirds/images onto a finished video in one ffmpeg pass. |
|
Render a title card to |
- tituli.tools.calligram(text, *, out='calligram.png', shape='wave', size=None, background='#f4f1e8', upright=False, mask=None, reveal=None)[source]¶
Lay
textalong a shape (circle,wave,arc, an SVG path,rain).shape="rain"is Apollinaire’s Il pleut (lines become streaks; give it a portraitsize).mask(an image path, light = inside) pours the text into a silhouette instead.reveal(seconds) writes an MP4 with a glyph-by-glyph reveal rather than a PNG.- Return type:
- tituli.tools.caption(image, text, attribution='', *, out='captioned.png', anchor='auto', avoid='saliency', delivery='youtube', size=None, overlay_only=False)[source]¶
Put a museum-label caption and a tiny attribution on
image.Placement avoids the subject (
avoid="saliency"usesburnswhen installed, otherwise nothing is avoided) and the delivery target’s reserved zones.overlay_onlywrites a transparent PNG to composite onto motion video instead of the flattened picture.- Return type:
- tituli.tools.credits(spec, *, out='credits.mp4', mode='crawl', size=None, speed=None, hold=None, background=None, audio=None)[source]¶
Render credits from a JSON spec file (or JSON string) to
out.Spec:
{"title": ..., "sections": [{"heading": ..., "entries": [["Role", "Name"], "Name", ...]}], "closing": [...]}— or a plain JSON list of lines.modeis"crawl"(one MP4) or"cards"(PNG per card, or one MP4 whenoutends in .mp4). Never truncates.- Return type:
- tituli.tools.fonts(query='')[source]¶
List installed font families (optionally filtered by substring).
- Return type:
- tituli.tools.lower_third(name, role='', *, out='lower_third.png', background=None, size=None, delivery='youtube')[source]¶
A name + role block, bottom-left, as a transparent overlay (or on a picture).
- Return type:
- tituli.tools.overlay_video(video, overlays, *, out='overlaid.mp4', delivery='youtube', pad_start=0.0)[source]¶
Composite captions/lower thirds/images onto a finished video in one ffmpeg pass.
overlaysis a JSON file/string: a list of{"start", "end", "text", "attribution"?, "kind"?: "caption"|"lower_third", "role"?, "anchor"?}or{"start", "end", "image", "fade_in"?, "fade_out"?}(a frame-sized PNG, e.g. a title page; it occupies its own slot and suppresses no caption — time captions after it). Text is laid out against the video’s frame size; the picture under each overlay is not sampled (pass a still throughcaptionfor that).pad_startseconds are added at the head (first frame held, audio delayed); overlay times are on the padded timeline.- Return type:
- tituli.tools.title_card(title, subtitle='', *, out='title.png', background=None, size=None, kicker='', anchor='center', avoid=None, duration=None)[source]¶
Render a title card to
out(PNG, or MP4 whendurationis given).backgroundis a colour (#101014), an image path, or nothing (a transparent overlay).anchoris a grid position;avoidis"saliency"or"x,y,w,h"to keep the title off the subject.- Return type: