kinemo API reference

kinemo 0.21.1 (IR 1.0.0). Every name in kinemo.__all__ and every public method of a public class, with signatures, parameters, props and canonical examples. Examples start with import kinemo as k and pass kinemo check --strict.

Also: Diagnostics, Command line, Configuration.

Scene

Scenes, the timeline cursor and the blocks that shape time (s.play, s.start, s.during).

  • k.scene: Turns a function def name(s: k.Scene) into a scene.
  • k.SceneDef: A scene function plus its configuration.
  • k.scene_preset: A scene decorator with defaults of its own, for a series or a shared library: episode = k.scene_preset(tail=1.0, theme="light"), then @episode or @episode(params=...).
  • k.Scene: Timeline of one scene.
  • k.TimeSpan: Where a play/start landed.
  • k.Voice: A narration line: when it starts and ends in the scene, and when each word is said.
  • k.Script: Narration kept outside the code, by beat: a Markdown file with a heading per beat (### B03 · Title, the first word is the id) and its narration on > lines, or JSON ({"B03": "..."}).
  • k.Captions: The narration as captions burned into the video, for viewers who watch muted.
  • k.time: Global scene time in seconds, as a read-only signal.

Methods:

  • s.play: Schedules animations at the cursor and advances the cursor to their end.
  • s.start: Schedules animations at the cursor without moving it: this is how to run something in the background (clocks, simulations, continuous motion) while the script continues.
  • s.wait: Advances the cursor by d seconds (default 1).
  • s.wait_for: Moves the main cursor to the time of an event (the count-th firing after the cursor) and returns the EventInfo.
  • s.add: Puts objects in the scene instantly, at the cursor.
  • s.remove: Takes objects out of the scene instantly, at the cursor.
  • s.mark: Creates a time anchor at the cursor without moving it and returns the time.
  • s.during: with block that applies state changes on entry and reverts them, animated, on exit.
  • s.tempo: with block that multiplies the speed of everything inside: s.tempo(4) divides durations and waits by 4.
  • s.voice: Narrated with block: takes text (TTS from the provider in kinemo.toml) or an audio file (text= says what it says), and lasts at least as long as the audio.

Object state

Changing objects: animated state changes (.to()), instant writes (.set()), copies.

  • k.StyleKeywords: The keyword arguments of shapes and text, as types, to reuse a style with ** and keep it checked: k.PaintKeywords (fill, fill_opacity, stroke, stroke_width, dash), k.ColorKeywords (color), k.TransformKeywords (position, rotation, scale, opacity, visibility), k.StyleKeywords (all of those), and k.TextKeywords, k.RectKeywords, k.ArrowKeywords for the keywords those objects add.
  • k.ArrowKeywords: The keyword arguments of shapes and text, as types, to reuse a style with ** and keep it checked: k.PaintKeywords (fill, fill_opacity, stroke, stroke_width, dash), k.ColorKeywords (color), k.TransformKeywords (position, rotation, scale, opacity, visibility), k.StyleKeywords (all of those), and k.TextKeywords, k.RectKeywords, k.ArrowKeywords for the keywords those objects add.
  • k.ColorKeywords: The keyword arguments of shapes and text, as types, to reuse a style with ** and keep it checked: k.PaintKeywords (fill, fill_opacity, stroke, stroke_width, dash), k.ColorKeywords (color), k.TransformKeywords (position, rotation, scale, opacity, visibility), k.StyleKeywords (all of those), and k.TextKeywords, k.RectKeywords, k.ArrowKeywords for the keywords those objects add.
  • k.PaintKeywords: The keyword arguments of shapes and text, as types, to reuse a style with ** and keep it checked: k.PaintKeywords (fill, fill_opacity, stroke, stroke_width, dash), k.ColorKeywords (color), k.TransformKeywords (position, rotation, scale, opacity, visibility), k.StyleKeywords (all of those), and k.TextKeywords, k.RectKeywords, k.ArrowKeywords for the keywords those objects add.
  • k.RectKeywords: The keyword arguments of shapes and text, as types, to reuse a style with ** and keep it checked: k.PaintKeywords (fill, fill_opacity, stroke, stroke_width, dash), k.ColorKeywords (color), k.TransformKeywords (position, rotation, scale, opacity, visibility), k.StyleKeywords (all of those), and k.TextKeywords, k.RectKeywords, k.ArrowKeywords for the keywords those objects add.
  • k.TextKeywords: The keyword arguments of shapes and text, as types, to reuse a style with ** and keep it checked: k.PaintKeywords (fill, fill_opacity, stroke, stroke_width, dash), k.ColorKeywords (color), k.TransformKeywords (position, rotation, scale, opacity, visibility), k.StyleKeywords (all of those), and k.TextKeywords, k.RectKeywords, k.ArrowKeywords for the keywords those objects add.
  • k.TransformKeywords: Props every object has (groups, containers, charts).
  • k.Node: Objects are values: creating one does not put it in the scene (use s.add or a verb).
  • k.reparent: Moves an object to another group at the scheduled time, keeping its world position (inside a container, it takes its place in the flow).

Methods:

  • obj.to: Animated state change: interpolates each prop from its value at the cursor to the target.
  • obj.set: Instant change at the cursor.
  • obj.unbind: Removes reactive bindings (all props when no name is given), keeping the current value.
  • obj.copy: Creates a new identity with the same props.

Verbs

Entrance, exit and emphasis animations (k.draw, k.fade_out, k.indicate, k.morph).

  • k.draw: Entrance verb: traces the outline and then fills it.
  • k.write: Entrance verb: writes the text character by character.
  • k.fade_in: Entrance verb: opacity from 0 to 1.
  • k.fade_out: Exit verb: opacity from 1 to 0, and then the objects leave the scene.
  • k.grow: Entrance verb: scales up from the center (default) or from a side (from_="bottom", "left", "top-left"...).
  • k.shrink: Exit verb: the inverse of k.grow.
  • k.indicate: Emphasis: temporarily tints and pulses the object; the final state equals the initial one.
  • k.flash: Emphasis: a ring of light that expands from the object's edge and fades away.
  • k.squash: Emphasis: an elastic squash against the object's base; amount= controls the intensity.
  • k.follow: Motion: the object travels along a path (the outline of another object or a list of points, in world coordinates).
  • k.sound: Audio: plays a sound file at the moment it is scheduled (zero duration in the script).
  • k.sfx: Built-in sound effects for k.sound: k.sfx.click(), tick(), pop(), swish(), whoosh() and ding() return the file of each effect.
  • k.music: Background music from the scheduled instant to the end of the scene: gain= sets its level, duck= its level while a voice speaks (0.25 = a quarter; 1 = no ducking), and fade= fades it in at its start and out at the end of the scene, in seconds.
  • k.morph: Swap: a leaves, b enters and the matching parts travel between them (identical characters and tokens slide; the rest fades out and in).

Composition

Combining animations in sequence, in parallel and with a lag; reusable clips; easing.

  • k.seq: Composes animations in sequence: each one starts when the previous one ends.
  • k.par: Composes animations in parallel: they all start together and the group lasts as long as the longest one.
  • k.stagger: Staggers a list of animations: each one starts lag seconds after the previous one.
  • k.clip: Decorator that turns a function def name(s: k.Scene, ...) into a reusable sequence with its own cursor.
  • k.Animation: Immutable: only has an effect when passed to s.play or s.start.
  • k.ease: Easing curves.

Methods:

  • anim.with_: Returns a copy of the animation with a different duration, easing or delay.

Objects

Shapes, groups, images, SVG and mass objects (points, vector fields, stream lines).

  • k.Array: An array for algorithm videos: cells with the values and the indices under them (index=False hides them), cell= size.
  • k.Callout: A speech bubble or callout beside to= (an object), with a tail pointing at it, that follows it: side= ("top-right", "left", ...), style="bubble" (filled), "box" (outlined) or "line" (text with a leader line), gap=, max_width= (the text wraps), size=, color=.
  • k.Gauge: A dial whose needle follows value= (a number or a signal, clamped to range=): numbered ticks=, sweep= degrees (240), zones=[(lo, hi, color)], a readout with label= under the hub.
  • k.Card: A panel around content (sized to it, or w=, h=): title= in its top-left corner, caption= under it, accent= a color bar beside the title; pad=, radius=.
  • k.Angle: Angle markers.
  • k.RightAngle: k.RightAngle(a, vertex, b, size=0.3): the square mark of a right angle at vertex, along the rays toward a and b.
  • k.Circle: Circle of radius r, centered on its position.
  • k.Dot: Filled dot (default radius 0.08), with no stroke.
  • k.Ellipse: Ellipse of width w and height h, centered on its position.
  • k.Rect: Rectangle of width w and height h, centered on its position; radius= rounds the corners (for rounded corners prefer k.RoundedRect).
  • k.RoundedRect: Rectangle with rounded corners (radius=0.15 by default).
  • k.Square: Square with side side, centered on its position.
  • k.Polygon: Polygon from its vertices (k.Polygon((0, 0), (2, 0), (1, 1))), centered on its bounding box.
  • k.Triangle: Triangle from its three vertices (no arguments: equilateral with radius 1).
  • k.Line: Segment from start to end (local coordinates), or centered with length=.
  • k.Arrow: Arrow from start to end with a tip of size tip.
  • k.Sector: A pie slice from the center, or a ring slice with inner= (its inner radius): r=, angle= (degrees, counterclockwise; negative goes clockwise) and start_angle= from +x.
  • k.Arc: Circular arc of radius r, starting at start_angle and sweeping angle degrees (counterclockwise).
  • k.Path: Path from SVG commands (d="M 0 0 L 1 1") or a polyline from a list of points; closed=True closes the outline.
  • k.union: Boolean operations between shapes: k.union(a, b), k.intersect(a, b) and k.subtract(a, b) return a new k.Path computed from the outlines at the cursor (with the style of a, unless another one is passed).
  • k.intersect: Shape covering both a and b.
  • k.subtract: a with b cut out.
  • k.Bar: A value shown as a bar that grows from its base, with an optional label (label=True).
  • k.Group: Groups objects: transforms compose and opacity multiplies.
  • k.Graph: Nodes and edges: k.Graph(nodes, edges, layout=...) with names as nodes and (u, v) or (u, v, weight) edges (arrows with directed=True).
  • k.Matrix: A matrix whose entries are objects in a grid: numbers, TeX strings (typeset with k.Math) or any object, between brackets= ("[", "(", "|", "none").
  • k.matrix_product: Shows a product row by column: k.matrix_product(a, b, a @ b) draws the product's brackets, then for each entry indicates its row of a and its column of b while the entry appears (step= seconds each).
  • k.Bits: A binary register: the bits of a value, most significant first, lit when 1.
  • k.TitleCard: An episode's opening card: the title, a kicker= above it, an accent rule under it and a subtitle=.
  • k.EndCard: What comes next: heading= ("Next") over the next title, then brand=, series= and an invite=.
  • k.LowerThird: A name and a role beside an accent bar, for a corner (side="right" mirrors it); place it as usual.
  • k.BrowserWindow: Device frames that hold content, styled to the theme: k.BrowserWindow(content, url=, w=, h=) (dots and an address bar), k.Phone(content, w=, h=) and k.Laptop(content, w=).
  • k.Laptop: k.Laptop(content, w=7): a laptop screen in its bezel above a keyboard base; the content fills the screen.
  • k.Phone: k.Phone(content, w=2.4, h=5): a phone body with its screen, a camera pill and a home bar; the content fills the screen.
  • k.Epicycles: The Fourier series of a closed path (points as tuples or complex numbers), as a chain of n rotating circles, largest first, whose tip traces the path; or coefficients= (frequency → complex amplitude) directly.
  • k.Icon: A built-in icon, drawn with strokes on a square of side size=: "check", "x", "warning", "lightbulb", "gear", "user", "cpu", … (k.ICON_NAMES lists them).
  • k.ICON_NAMES: A built-in icon, drawn with strokes on a square of side size=: "check", "x", "warning", "lightbulb", "gear", "user", "cpu", … (k.ICON_NAMES lists them).
  • k.Image: Raster image (PNG or JPEG) drawn by the renderer, centered on its position.
  • k.SVG: Imports an SVG illustration (a file or inline markup): each shape becomes a k.Path with the SVG's fill, stroke and stroke width, and each <g> becomes a k.Group.
  • k.Brace: Curly brace (}) along one side of an object's box: direction= "down", "up", "left" or "right", gap units away from it, with the tip pointing outward.
  • k.Points: Thousands of points in a single object, batch-drawn in the core.
  • k.VectorField: Arrows of a field fn(x, y) -> (vx, vy) on a grid with density columns across the width of the region (x_range, y_range).
  • k.StreamLines: Streamlines of a field (a k.VectorField or a function), integrated with RK4 in the core from seeds (a count or points).

Methods:

  • graph.add_node: A new node and its edges= grow in; without at= the graph is laid out again with it and the other nodes move to make room.
  • graph.path: Highlights a path: its nodes and the edges between them take color one after the other (the accent color by default), for searches and shortest paths.
  • graph.relayout: Moves the nodes to a new layout as a transition (another named layout, positions, or the current one again after changes); edges follow their nodes.

Text

Text, LaTeX math and highlighted code, with addressable parts.

  • k.Text: Text with minimal inline markup (**bold**, *italic*, `code`).
  • k.Math: Formula in LaTeX syntax, typeset by the built-in engine (no TeX installation needed).
  • k.Code: Code with syntax highlighting (tree-sitter) and stable tokens: lang=, line_numbers=True, size=, theme="auto" (follows the scene background).
  • k.underline: Annotation marks on any object or part of a text or formula (eq["dx"]): k.underline(target), k.box(target), k.encircle(target), k.strike(target) (crossed out) and k.cross(target) (an X).
  • k.box: A rounded box around target, pad away from its box.
  • k.cross: An X over target: two lines corner to corner, pad past its box.
  • k.encircle: An ellipse around target (its box, pad larger on each side, times √2 so the corners fit inside).
  • k.strike: A line through the middle of target (struck out), overhang past each side.
  • k.Terminal: A terminal or REPL window: title=, prompt= ("$ ", ">>>"), lang= of the commands ("bash", "python"...), width= and rows= on screen, size=, theme="auto".

Methods:

  • terminal.type: Named transition: types a command after the prompt, character by character, as k.Code in the terminal's language, with the caret following; cps= characters per second (22 by default) or duration=.
  • terminal.output: Named transition: prints text below the last row, one row per line, all at once or stagger= seconds apart; lines that do not fit scroll the older ones up.
  • code.highlight: Named transition: dims every line except lines (numbered from 1); code.highlight(None) removes the highlight.

Layout

Placement by constraints (.place) and containers (k.Row, k.Column, k.Grid, k.Stack).

  • k.Row: Container that lays its children out in a row (flexbox), with gap= and align= ("center", "top", "bottom").
  • k.Column: Container that stacks its children in a column, with gap= and align= ("center", "left", "right").
  • k.Grid: Grid container with cols= columns and gap=.
  • k.Stack: Container that overlays its children, centered (or aligned by align=).

Methods:

  • obj.place: Declares where the object sits, relative to the frame (at="top", margin=) or to another object (above=, below=, left_of=, right_of=, inside= with pad=), with gap= (accepts a signal) and align=.
  • obj.to_place: Animated change of placement: the .to of .place.
  • obj.unpin: Releases the position constraint at the cursor: the object keeps its current position and is free to animate x/y.
  • group.fit: Scales the group once, at the cursor, until it fits an area (usually s.frame.safe, the frame's safe area), with an optional margin=.
  • group.swap: Named transition: swaps the places of two children and the container animates the reflow.
  • group.insert: Named transition: inserts a child at position i; it enters together with the reflow.
  • group.pop: Named transition: removes the child at position i (default: the last one); it exits together with the reflow.

Charts

Axes, number lines, polar axes, plots and data charts.

  • k.PolarAxes: Polar axes (rings and spokes): r=(0, r_max, step), radius= in units, spokes=.
  • k.Axes: Cartesian axes with ticks, labels and an optional grid: x=(min, max, step), y=(min, max), labels=("x", "y"), width=/height= in units.
  • k.Timeline: Events along a time axis: k.Timeline([(1687, "Principia"), ...], range=(1600, 2000)) draws labelled ticks and a marker per event, its label on the first row above or below the axis where it clears the others.
  • k.NumberLine: A horizontal number line: a k.Axes with only the x axis.
  • k.NumberPlane: A coordinate grid with axes and the basis vectors î (green) and ĵ (red): x=(min, max, step), y=..., unit= scene units per step.
  • k.ComplexPlane: A k.NumberPlane labelled as the complex plane (real ticks, i ticks, Re/Im) whose points are complex numbers: cp.dot(2 + 1j), cp.vector(1 - 2j), cp.coords(z).
  • k.vector_sum: Adds two axes vectors tip to tail: b slides so its tail sits on a's tip, then the resultant (a + b) is drawn from a's tail.
  • Plot: A curve y = fn(x) of an axes.
  • k.BarChart: Bar chart from a table: x= is the category column, y= the value column and key= identifies each bar.
  • k.PieChart: One slice per row of a table: labels= names the category column and values= the numbers; donut=0.5 leaves a hole (a fraction of radius=).
  • k.LineChart: A k.Axes with one line per y= column (one or several), connecting the table's points in x= order.
  • k.Table: Table of k.Text with a highlighted header; columns= selects and orders the columns.

Methods:

  • ax.parametric: Parametric curve (fx(t), fy(t)) for t=(start, end); clipped to the visible ranges.
  • numberplane.apply: Animated transformation of the plane, composed after the ones already applied: a matrix [[a, b], [c, d]] sends î to (a, c) and ĵ to (b, d); a function (x, y) -> (x2, y2) bends the grid for non-linear maps.
  • numberplane.polygon: A filled shape with vertices in data coordinates that deforms with the plane.
  • ax.plot: Draws the curve y = fn(x) on the axes, with adaptive sampling.
  • ax.area: Filled region under a curve (down to the x axis) or between two curves (between=).
  • ax.vline: Vertical line on the axes at at= (accepts a signal: the line moves with it); style="dashed" makes it dashed.
  • ax.hline: Horizontal line on the axes at at= (accepts a signal); style="dashed" makes it dashed.
  • ax.scatter: Points (xs[i], ys[i]) on the axes, as a group of k.Dot.
  • ax.zoom_to: Named transition: animates the visible ranges of the axes (x=(a, b), y=(c, d)).
  • ax.point: Data point (x, y) in world coordinates, reactive when x or y are signals.
  • ax.add: Puts objects inside the axes, in its own coordinates, so they follow zooms like plots do; place them with position=ax.local_point(x, y) or ax.origin().
  • ax.segment: A line between two data points (x, y), cut to the visible ranges with clip=True (the default) and hidden when it falls entirely outside them; it follows zooms.
  • ax.hband: ax.hband(y0, y1): a translucent band across the plot between two data values; ax.vband(x0, x1) the same up the plot.
  • ax.vector: An arrow of components v from the data point at=, in data units; both are signals, so vector.to(v=(2, 1)) turns it and it follows zooms.
  • ax.dot: A dot at a data point that follows zooms; open=True draws it hollow (filled with the background) for an endpoint a piecewise function leaves out.
  • ax.origin: Where the two axes cross, in the axes' own coordinates: the data origin clamped to the visible ranges.
  • ax.in_view: Whether a data value is inside the visible ranges, as a reactive bool for visible=: ax.in_view(x=3), ax.in_view(y=5) or both.
  • curve.point_at: World position of the curve at x; reactive when x is a signal.
  • curve.tangent_at: Tangent segment length units long, centered on the curve at x, reactive when x is a signal.
  • curve.slope_at: Numerical derivative of the curve at x, reactive when x is a signal.

Reactive

Signals, derived values and reactive collections.

  • k.signal: A value with a timeline.
  • k.Signal: A value that changes over the timeline: .set (instant), .to (animated), .now.
  • k.computed: Derived value with several dependencies: k.computed(lambda: f(a(), b())).
  • k.Expr: A value that may change over time.
  • k.list: List signal.
  • k.ListSignal: Python lists are not tracked; k.list([...]) is.
  • k.python: Marks an opaque Python function (external libraries, math, untraceable logic).
  • k.lerp: Interpolation modes of a signal, passed as k.signal(..., lerp=): linear (default), round (integers), step (switches at the end), step_start (switches at the start) and pointwise (lists of points, point by point).

Methods:

  • x.map: Applies a function to a signal: hour.map(solar_curve).

Native blocks

Math blocks that run in the native core inside lambdas, .map and plots.

  • k.sin: Native math functions: k.sin, k.cos, k.tan, k.exp, k.log, k.sqrt and k.atan2(y, x).
  • k.atan2: Native math functions: k.sin, k.cos, k.tan, k.exp, k.log, k.sqrt and k.atan2(y, x).
  • k.cos: cos(x), native on signals.
  • k.exp: exp(x), native on signals.
  • k.log: ln(x), native on signals.
  • k.sqrt: sqrt(x), native on signals.
  • k.tan: tan(x), native on signals.
  • k.floor: Native rounding down (k.floor) and up (k.ceil).
  • k.ceil: ceil(x), native on signals.
  • k.min: Native minimum and maximum of two or more values (k.min(a, b, c)).
  • k.max: Native minimum and maximum of two or more values (k.min(a, b, c)).
  • k.clamp: Clamps a value to the range [lo, hi], natively.
  • k.where: The traceable if: a where cond holds, otherwise b.
  • k.piecewise: Piecewise function: k.piecewise((cond1, v1), (cond2, v2), default=v); the first true condition wins.
  • k.spline: Smooth table interpolation (natural cubic spline): k.spline(x, xs, ys).
  • k.interp: Linear table interpolation: k.interp(x, xs, ys).
  • k.mix: Linear mix a + (b - a) * t of numbers, vectors or colors (colors in OKLab, with no gray in the middle).
  • k.smoothstep: Smooth transition from 0 to 1 as x goes from e0 to e1 (cubic Hermite).
  • k.noise: Smooth, deterministic noise in [-1, 1] (seed= changes the sequence).
  • k.vec: 2D vector from two values (numbers or signals).
  • k.Vec: Vec(x, y)
  • k.pi: Constants k.pi, k.tau (2π) and k.e, for use inside traced functions.
  • k.e: Constants k.pi, k.tau (2π) and k.e, for use inside traced functions.
  • k.tau: Constants k.pi, k.tau (2π) and k.e, for use inside traced functions.

Stateful systems

Conditions, integration and simulations resolved before rendering.

  • k.when: Edge-triggered effect: when cond goes from false to true, it fires an animation or emits an event.
  • k.integrate: Integral of an expression with respect to the change in d= (default k.time), starting at the cursor, with initial= and clamp=(lo, hi).
  • k.simulate: Fixed-step simulation: step(state, dt) -> state, run in Python during resolve.
  • k.State: Base of simulation states: plain fields (floats, bools, pairs) plus k.Events. class Ball(k.State): y: float = 4.0 v: float = 0.0 bounce: k.Event[Impact]
  • k.trace: Trail: the last length seconds of the path of a moving point (usually obj.world.position), drawn as a stroke.
  • k.Trail: Trail: the last length seconds of the path of a moving point (usually obj.world.position), drawn as a stroke.

Events

Event sources and handlers.

  • k.EventSource: A concrete event of one owner.
  • k.EventInfo: One firing of an event, received by .on handlers and returned by s.wait_for: e.time (instant), e.data (typed payload), e.count (n-th firing) and e.value(sig) (value of any signal at the instant of the event).

Methods:

  • event.on: Decorator that reacts to every firing of an event: @source.on registers def handler(s, e), run during resolve with its own s whose cursor starts at e.time (the main cursor does not change).

Components

Reusable components with props, outputs, events and context.

  • k.Component: The only kind of reusable object: a subclass with props (k.Prop[T], inputs), static fields (name: T = default), outs (k.Out[T], outputs as signals) and events (k.Event), plus a build() that runs once and returns the visual.
  • k.Prop: Declares a reactive component prop: power: k.Prop[float] = k.prop(0.0).
  • k.Out: Declares a continuous component output: soc: k.Out[float].
  • k.Event: Declares an event on a component or a k.State: full: k.Event or, with a typed payload, bounce: k.Event[Impact].
  • k.field: Validated default for a static component field: k.field(0.2, range=(0, 1)) or k.field("a", choices=[...]).
  • k.prop: Validated default for a reactive prop: k.prop(0.0, range=(-5, 5)).
  • k.context: Declares a context (at module level): a value that many components need (clock, scale, unit), supplied with k.provide instead of passed down prop by prop.
  • k.Context: Clock = k.context("clock", default=k.time), declared at module level.
  • k.provide: with block that supplies a context value to the components constructed inside it.
  • k.from_context: Prop or field default that reads a context: time: k.Prop[float] = k.from_context(Clock).

Parameters

Scene parameters for the interactive player and exports.

  • k.Int: Integer scene parameter in the range [lo, hi]: k.Int(3, 12, default=5).
  • k.Float: Real-valued scene parameter in the range [lo, hi]: k.Float(0.5, 2, default=1).
  • k.Bool: Boolean scene parameter: k.Bool(default=True).
  • k.Choice: Scene parameter with fixed options: k.Choice([k.BLUE, k.RED]) (the default is the first option, or default=).
  • k.Str: Text scene parameter: k.Str(default="...").

Interactive lessons

  • k.Point: A position as an answer: the learner drags a point, and correct=(x, y) with tolerance= grades it.

Methods:

  • s.ask: Stops playback for a question; the learner answers in the lesson player (or in kinemo dev).
  • s.answer: An answer the scene uses before its question is asked: the learner moves a slider (or drags a point) and the frame follows.

Output

Movies made of several scenes and the transitions between them.

  • k.movie: Composes several scenes into a single output, with one transition per join (k.cut when omitted).
  • k.Movie: Composes several scenes into a single output, with one transition per join (k.cut when omitted).
  • k.cut: Hard-cut transition between two scenes of a k.movie (the default).
  • k.crossfade: Transition in which the end of one scene dissolves into the start of the next, over duration seconds.
  • k.morph_cut: Transition in which objects with the same key= in neighboring scenes travel across the cut.

Theme and colors

Themes, theme tokens and colors.

  • k.theme: Tokens of the current theme: k.theme.bg, fg, accent, muted, secondary.
  • k.themes: Built-in themes: k.themes.dark (default), k.themes.light and k.themes.blueprint.
  • k.Theme: Built-in themes: k.themes.dark (default), k.themes.light and k.themes.blueprint.
  • k.BLUE: Fixed palette: k.BLUE, k.RED, k.GREEN, k.YELLOW, k.ORANGE, k.PURPLE, k.PINK, k.TEAL, k.WHITE, k.BLACK, k.GRAY and k.TRANSPARENT.
  • k.BLACK: Fixed palette: k.BLUE, k.RED, k.GREEN, k.YELLOW, k.ORANGE, k.PURPLE, k.PINK, k.TEAL, k.WHITE, k.BLACK, k.GRAY and k.TRANSPARENT.
  • k.GRAY: Fixed palette: k.BLUE, k.RED, k.GREEN, k.YELLOW, k.ORANGE, k.PURPLE, k.PINK, k.TEAL, k.WHITE, k.BLACK, k.GRAY and k.TRANSPARENT.
  • k.GREEN: Fixed palette: k.BLUE, k.RED, k.GREEN, k.YELLOW, k.ORANGE, k.PURPLE, k.PINK, k.TEAL, k.WHITE, k.BLACK, k.GRAY and k.TRANSPARENT.
  • k.ORANGE: Fixed palette: k.BLUE, k.RED, k.GREEN, k.YELLOW, k.ORANGE, k.PURPLE, k.PINK, k.TEAL, k.WHITE, k.BLACK, k.GRAY and k.TRANSPARENT.
  • k.PINK: Fixed palette: k.BLUE, k.RED, k.GREEN, k.YELLOW, k.ORANGE, k.PURPLE, k.PINK, k.TEAL, k.WHITE, k.BLACK, k.GRAY and k.TRANSPARENT.
  • k.PURPLE: Fixed palette: k.BLUE, k.RED, k.GREEN, k.YELLOW, k.ORANGE, k.PURPLE, k.PINK, k.TEAL, k.WHITE, k.BLACK, k.GRAY and k.TRANSPARENT.
  • k.RED: Fixed palette: k.BLUE, k.RED, k.GREEN, k.YELLOW, k.ORANGE, k.PURPLE, k.PINK, k.TEAL, k.WHITE, k.BLACK, k.GRAY and k.TRANSPARENT.
  • k.TEAL: Fixed palette: k.BLUE, k.RED, k.GREEN, k.YELLOW, k.ORANGE, k.PURPLE, k.PINK, k.TEAL, k.WHITE, k.BLACK, k.GRAY and k.TRANSPARENT.
  • k.TRANSPARENT: Fixed palette: k.BLUE, k.RED, k.GREEN, k.YELLOW, k.ORANGE, k.PURPLE, k.PINK, k.TEAL, k.WHITE, k.BLACK, k.GRAY and k.TRANSPARENT.
  • k.WHITE: Fixed palette: k.BLUE, k.RED, k.GREEN, k.YELLOW, k.ORANGE, k.PURPLE, k.PINK, k.TEAL, k.WHITE, k.BLACK, k.GRAY and k.TRANSPARENT.
  • k.YELLOW: Fixed palette: k.BLUE, k.RED, k.GREEN, k.YELLOW, k.ORANGE, k.PURPLE, k.PINK, k.TEAL, k.WHITE, k.BLACK, k.GRAY and k.TRANSPARENT.
  • k.rgb: Color from components from 0 to 1 (a= is the opacity).
  • k.Color: Color from components from 0 to 1 (a= is the opacity).

Tooling and types

Names for tools and type annotations rather than scene code.

  • k.Diagnostic: Diagnostics are read with kinemo check and kinemo explain <code>.
  • k.IR_VERSION: IR format version, for tools.
  • k.KinemoError: A build error.
  • k.Val: Type alias T | Signal[T] | Callable[[], T], for annotations only.

Other pages

  • Diagnostics: Every error and lint code, grouped by range, with explanations and fixes.
  • Command line: Every kinemo subcommand with its arguments and examples.
  • Configuration: kinemo.toml, @k.scene options, sizes and quality presets.