Skip to main content

Lightweight motion graphics for explainers — Typst math, Skia rendering, PyAV MP4 export, built for speed and LLM-friendly scene code.

Project description

MotionGram 📽️

The grammar of motion graphics.

Lightweight motion graphics for explainers and teaching clips: Typst math → SVG, Skia rasterization, PyAV MP4 export, optional Kitten TTS narration. Scene APIs favor explicit timelines and small composable primitives— approachable for humans and for LLM-assisted authoring.

MotionGram preview

Install and import as motiongram (pip install -e ".[dev]" from this repo).

Goal Target
Cold render Fast path vs typical LaTeX-disk + subprocess-encode pipelines
Install size ~80 MB core ([tts] optional: upstream Kitten stack + HF models, much larger)
Math Typst → SVG (no TeX Live)
Render Skia (no Cairo)
Encode PyAV in-memory (no per-frame disk + FFmpeg subprocess)
Voice-over Kitten TTS local TTS, Apache-2.0 (optional [tts] extra)

Installing [tts] may pull a large dependency tree (for example PyTorch and friends) as required by upstream kittentts 0.8.x — keep it optional. Core animation deps stay separate.

Status: pre-alpha — core rendering pipeline (Skia + Typst + PyAV) is functional; see docs/ for requirements and design.

Tutorial: step-by-step build from ASCII to PyAV-oriented design in learn/ (phases 000100).

Demo

Short reel rendered from examples/showcase_intro.py (720p). The same file is committed as docs/assets/readme-demo.mp4 so it shows up on GitHub without relying on external hosting.

Regenerate locally:

motiongram render examples/showcase_intro.py -o docs/assets/readme-demo.mp4

Running python examples/showcase_intro.py writes showcase_intro.mp4 in the current working directory; move or rename it if you are refreshing the committed demo.

If the preview does not load (some viewers block autoplay), open docs/assets/readme-demo.mp4 directly.

Quick start

# Install (requires Python 3.11+)
uv pip install -e ".[dev]"

# Install Typst CLI for math rendering
curl -fsSL https://github.com/typst/typst/releases/latest/download/typst-x86_64-unknown-linux-musl.tar.xz \
  | tar -xJ --strip-components=1 -C ~/.local/bin/

# Polished 720p showcase (recommended)
motiongram render examples/showcase_intro.py -o showcase.mp4

# Full-stack demo (text + math + code + circle)
motiongram render examples/math_and_text.py -o output.mp4

# Or run directly
python examples/showcase_intro.py
python examples/math_and_text.py

See the Setup Guide for platform-specific instructions.

Principles gallery

Twelve drawing and twelve animation principle demos live under examples/principles/. Each script writes an MP4 next to itself (those outputs stay gitignored).

python examples/principles/04_value.py

Index and topics: Principles examples guide.

Documentation

License

MIT — see LICENSE.

Author

Nabin Oli

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

motiongram-0.2.0.tar.gz (837.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

motiongram-0.2.0-py3-none-any.whl (47.3 kB view details)

Uploaded Python 3

File details

Details for the file motiongram-0.2.0.tar.gz.

File metadata

  • Download URL: motiongram-0.2.0.tar.gz
  • Upload date:
  • Size: 837.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for motiongram-0.2.0.tar.gz
Algorithm Hash digest
SHA256 480ff1d2c240f9455c3b5c35b1f74c35d928770827b702402eb9cfdd79c71157
MD5 b2c1ffc7026f39c29868b957e5e7cf07
BLAKE2b-256 08052e272beca12f17de89204dee46aac7376e0472887b0b3962e3924ccb56be

See more details on using hashes here.

File details

Details for the file motiongram-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: motiongram-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 47.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for motiongram-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5828c2796b64aa7aa412244e61910c2966584a2722e1e3dfa5ee85080410ca2a
MD5 f5aade95ed0dacd6f19cda8eb11e10b3
BLAKE2b-256 afbd7438ce16e46495af6c04dc12ef3eed23f3fba086041f59a560156732a794

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page