Skip to main content

kinemo

CI PyPI License: MIT OR Apache-2.0

Website and documentation

Explanatory animations (math, algorithms, engineering, data) written in Python, with a live preview and a native core in Rust. The API was designed to be written by people and by AI without errors: one form per concept, full typing, and errors that already carry the fix.

A tangent sliding along a curve, with the code that makes it

Made with kinemo: docs/media/hero.py.

import kinemo as k

@k.scene
def hello(s: k.Scene):
    title = k.Text("Hello, kinemo").place(at="center")
    s.play(k.write(title))
    s.play(title.to(color=k.BLUE, scale=1.5))
    s.wait(1)
pip install kinemo
kinemo new my-video        # a project with a first scene (then cd my-video)
kinemo dev scene.py        # browser preview with hot reload and a draggable timeline
kinemo check scene.py      # errors, lints and timeline summary, without rendering
kinemo render scene.py     # MP4 (also webm, mov, gif, png, slides)

The live preview

kinemo dev opens the scene in your browser and rebuilds it on every save. The timeline shows each animation with its line; drag it to any instant, and the code view follows.

kinemo dev: the timeline scrubbed while the code view highlights the running line

Click an object to see where each value came from (the constructor, a place, an animation) and edit the literals in place: dragging a number or picking a color writes it back to your source file.

kinemo dev: the inspector showing a dot's props and where each was set

Why kinemo

  • See it while you write it. kinemo dev re-renders on save and lets you scrub to any instant; the frame at t is a pure function of t, so jumping around is instant.
  • Mistakes are caught before you render. Lints find text that leaves the frame, overlaps, is too small or has too little contrast, at the instant it happens, with the fix; kinemo check --fix applies the safe ones.
  • Fast. The timeline, layout, text, math and rendering are Rust, and frames render in parallel on every core.
  • Nothing else to install. Math is typeset without LaTeX, code is highlighted with tree-sitter, fonts are embedded. Video needs ffmpeg, and that is all.
  • Built for agents. Typed, one way to do each thing, machine-readable checks and an MCP server: a model can write a scene, check it and fix it without looking at frames.

Compared with Manim

Manim is the reference for this kind of video, and it inspired kinemo. Choose by what you need:

Manim kinemo
Maturity Years of use, a large community, many tutorials and plugins Young (pre-1.0), a small community
3D Yes Not yet (2D only)
LaTeX Needs a TeX installation Built in (typst), no TeX
Preview Render, then watch Live preview with a scrubbable timeline
Time model Animations run as the script runs The script builds a timeline first: scrub, parallel render, caching
Errors Python tracebacks Coded diagnostics with line, instant and fix; visual lints
Narration Plugins Built in: TTS or recorded audio, word timing, subtitles

Coming from Manim: Create, .animate and other Manim names are recognized and the error names the kinemo form; the mental model explains the differences.

What kinemo does

  • The script runs once and produces a timeline. The frame at t is a pure function of t: you can scrub the timeline, render in parallel and keep everything cached.
  • Explicit time. s.play blocks the cursor, s.start does not; k.seq, k.par, k.stagger, s.during, s.tempo and clips (@k.clip) compose animations as values.
  • Constraint layout. .place(above=tri), k.Row, k.Grid: the relations keep holding while the objects move.
  • Reactive signals. x.to(3), k.Text(lambda: f"{x():.1f}"), ball.set(x=other.x). Lambdas and .map are traced to native code; opaque Python only with k.python(fn).
  • Events and stateful systems. k.when, @event.on, s.wait_for, k.integrate, k.simulate — resolved before rendering, up to a fixed point.
  • Text, code and math with addressable parts (txt["world"], code.highlight) and k.morph between versions.
  • Charts and data. k.Axes, plots that grow with a signal, animated zoom; data via Arrow (polars, pandas, pyarrow, duckdb) without copying.
  • Interactive lessons. s.ask stops for a question (a choice, a slider, a number, a point to drag), and with q.correct(): / with q.wrong(): hold what plays next. --format lesson writes a page that plays in any browser and embeds in a learning platform; as a video, each question becomes a quiz with time to pause and think before the reveal. Try the example lesson.
  • Narration. s.voice speaks with a TTS provider, any voice program or recorded audio, beat by beat from a script (k.Script); animations follow the words (v.at("the slope")), music ducks under the voice, and kinemo render --subtitles writes SRT and WebVTT.
  • Stable diagnostics. Every error has a code (K0401), line, instant and fix; kinemo check --fix applies the safe ones. Manim names (Create, .animate) are recognized and translated.
  • Built for agents. kinemo check --json, kinemo inspect --json, kinemo snap and the kinemo mcp server close the write → verify → fix loop without needing vision.

Installation

pip install kinemo

Wheels for Linux, macOS and Windows, Python ≥ 3.11. Video output needs ffmpeg:

System Command
macOS brew install ffmpeg
Windows winget install Gyan.FFmpeg (or choco install ffmpeg)
Ubuntu, Debian sudo apt install ffmpeg
Fedora sudo dnf install ffmpeg
Arch sudo pacman -S ffmpeg

kinemo doctor shows what kinemo finds (Python, ffmpeg, extras); PNG and SVG frames and kinemo dev work without ffmpeg. pip install "kinemo[align]" adds word timing for recorded narration (speech recognition).

Status

kinemo is before 1.0: the API can still change between minor versions. When it does, kinemo upgrade scene.py rewrites the old forms, and the changelog says what changed.

kinemo runs 100% on your machine: rendering is local, the kinemo dev preview listens only on localhost, and nothing is sent anywhere (a TTS provider you configure for narration is the only network call).

Questions and bugs

Questions, ideas and things you made go in Discussions; bugs go in issues (paste the output of kinemo doctor).

From source

Requirements: stable Rust, Python ≥ 3.11, uv and ffmpeg. See CONTRIBUTING.md for the tests and conventions.

uv venv .venv
uv pip install --python .venv/bin/python maturin pytest numpy polars
source .venv/bin/activate
maturin develop

GPU preview (optional): maturin develop --features gpu compiles the Vello (wgpu) backend and the kinemo dev server then rasterizes on the GPU when an adapter is available, falling back to the CPU (tiny-skia) otherwise. The default build does not include wgpu. The final render stays on the CPU, which is the reference.

Tests

cargo test --workspace          # Rust core
python -m pytest -q             # API, diagnostics, contracts and golden snapshots

Golden snapshots live in tests/golden/ (CPU renderer, byte-identical). To regenerate them after an intentional change: KINEMO_UPDATE_GOLDEN=1 pytest tests/python/test_golden.py.

Architecture

The author only sees Python; everything below the IR is Rust.

python/kinemo/        public API (k.*), build phase, handlers, CLI
crates/kinemo-ir      IR types (serializable scene)
crates/kinemo-eval    timelines, expressions, easing, colors (OKLab)
crates/kinemo-layout  geometry, containers, constraints, glyphs
crates/kinemo-text    text (rustybuzz), embedded fonts
crates/kinemo-code    code highlighting (tree-sitter) and diff
crates/kinemo-math    LaTeX → typst, no TeX installation
crates/kinemo-resolve sampling-based visual lints
crates/kinemo-render  display list, tiny-skia, morph, movies, segments
crates/kinemo-render-gpu  optional Vello (wgpu) backend, tolerance tests vs tiny-skia
crates/kinemo-encode  ffmpeg (mp4, webm, mov, gif)
crates/kinemo-server  preview (axum + WebSocket)
crates/kinemo-py      PyO3 bindings (the only crate that knows about Python)

Documentation

Start with the documentation index: numbered guides from getting started onwards, the complete API reference, examples with rendered frames, and caveats. The design document is docs/specs.md.

The same docs, with a landing page and the examples as videos, build into a static SvelteKit website: see website/README.md.

License

Licensed under either of Apache License 2.0 or MIT, at your option. Unless you state otherwise, any contribution you submit for inclusion in kinemo is dual-licensed as above, without any additional terms.

The embedded DejaVu fonts follow their license. The licenses of the Rust crates compiled into the wheels are in THIRD_PARTY_LICENSES.md (scripts/third_party_licenses.py regenerates it).

Metadata

Release files for kinemo 0.21.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kinemo 0.21.0
File Size Uploaded Provenance
kinemo-0.21.0.tar.gz 744.8 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for kinemo 0.21.0
File
kinemo-0.21.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
kinemo-0.21.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details
kinemo-0.21.0-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details
kinemo-0.21.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
kinemo-0.21.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details

Total release size: 168.4 MB

Release files / kinemo-0.21.0.tar.gz

Download URL kinemo-0.21.0.tar.gz
Size 744.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ca6d466d9b7b38e46af1b0ec8a25c8a19ec315f7dda25238dd1aaea7a86cdf8e
BLAKE2b-256 checksum
How to use checksums
4a372cd16125f4f70ef96a45221c5e6b218652af84049adc5d845abd786c1fb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / kinemo-0.21.0-cp311-abi3-win_amd64.whl

Download URL kinemo-0.21.0-cp311-abi3-win_amd64.whl
Size 32.0 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
85d5bace4b3fbce18fcc0dd004afee24cb5fd548175c2e6618343c13bc04c085
BLAKE2b-256 checksum
How to use checksums
7ee2f281f1ef54ce55747ed41e168fff906b23d513cd8bd0fd8aa2b8a8d01bc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / kinemo-0.21.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL kinemo-0.21.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 34.2 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
763740ea3cfb2f5e720be94d862ba1eb9a219b5a04fe0c2f563a0c9ecfe3e75f
BLAKE2b-256 checksum
How to use checksums
b0a57860febd838b5be0eecf3a0e6ce62b2e5132b16d05107cf8125e42f84ee6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / kinemo-0.21.0-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL kinemo-0.21.0-cp311-abi3-manylinux_2_28_aarch64.whl
Size 35.4 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
262458fb4b37621ebc44e6d18a18af1a496c94ce914f104cec4269b2cc707048
BLAKE2b-256 checksum
How to use checksums
48ad12371e5894576c643e387b393427b9bcb27fe2110b4b8f373289b8fb6e99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / kinemo-0.21.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL kinemo-0.21.0-cp311-abi3-macosx_11_0_arm64.whl
Size 32.9 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
41637ee10aa926073506a1959accb2e1a53569cf5e6c5c6721a27be3f62a59e2
BLAKE2b-256 checksum
How to use checksums
f5a82365d83eba40af16371380a94e473872230c0af79396d19d27b4dd1cfdf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / kinemo-0.21.0-cp311-abi3-macosx_10_12_x86_64.whl

Download URL kinemo-0.21.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 33.2 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
7b0c6c4f75cb7599e93ae4c2ba1f73e8e5a2dd3a8002160c762d95763bbcc0ba
BLAKE2b-256 checksum
How to use checksums
83e4955fe3f1772b16bbea19640ffd6308a53c8754e1f6bfd57f16a7e0bbd185
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for kinemo 0.21.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for kinemo-0.21.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page