Skip to main content

Algan

Full-featured 2D/3D programmatic animation engine for explanatory mathematics and technical videos.

Documentation PyPI version Python versions Discord Community License: MIT


Algan is designed to be a successor to Manim with full-featured 3-D raytracing capabilities.

As seen on AlgorithmicSimplicity.


Key Features

  • Manim Feature Parity: Everything you know and love from Manim.
  • GPU Ray Tracing: High-fidelity optical effects including depth of field, area lights, glossy reflections, refractive glass, and soft shadows.
  • Declarative Timeline Contexts: Intuitive animation staging with Seq(), Sync(), Lag(), Off(), and Speech() blocks makes animation code modular and re-usable.
  • Unified 2D/3D Geometry: Seamless morphing and interpolation between 2D Bézier circuits and 3D meshes with become().
  • Audio & Speech Alignment: Automatic word-level forced alignment to synchronize on-screen animations with narration.

Installation

pip install algan

Every dependency ships wheels, so there is nothing to build and no system package to install first. The installed footprint is large (~5 GB on Linux, mostly the CUDA build of torch and its NVIDIA dependencies).

Optional: Pango text on Linux

Text typesets with your system fonts through Pango, which is installed with Algan on Windows and macOS. manimpango publishes no Linux wheel, so on Linux it is an extra instead — without it Text falls back to LaTeX's text mode, and Manim's MarkupText and Paragraph are absent. Installing it builds Pango from source and wants its headers first:

sudo apt-get install -y build-essential python3-dev libpango1.0-dev pkg-config
pip install "algan[pango]"

For per-OS instructions (GPU acceleration, optional LaTeX for formulas, speech), see the Installation Guide.


Quickstart

Save this script as scene.py:

from algan import *

# 1. Make 3-D objects with physical materials
sphere = Sphere(color=BLUE, radius=1.2)
sphere.set_material(
    MeshPhysicalMaterial(
        roughness=0.15,
        metalness=0.1,
        clearcoat=1.0,
        clearcoat_roughness=0.08,
    )
)

# 2. Define animation timeline with contexts
sphere.spawn()
with Sync(runtime=2):
    sphere.move(RIGHT * 2)
    sphere.rotate(180, OUT, about=ORIGIN)
    sphere.color = RED

# 3. Render video
Scene.save_video("quickstart.mp4")

Run with Python or the Algan CLI:

# Using python
python scene.py

# Using the algan CLI
algan render scene.py

The output video will be written to algan_outputs/quickstart.mp4.


Command Line Interface (CLI)

Algan includes a first-class CLI:

algan check                 # Verify PyTorch, GPU acceleration, the kernel compiler, FFmpeg, LaTeX & paths
algan new my_scene.py       # Scaffold a new scene script
algan render my_scene.py    # Render scene to video

render takes -q {preview,ld,md,hd,production,uhd} for the video preset and -o for the directory or file to write to. Both fill in what the script leaves open: a Scene.save_video("intro") still decides the name, and a path with a directory in it still decides everything.

algan render my_scene.py -q hd -o renders/          # renders/intro.mp4, at HD
algan render my_scene.py --no-daemon -- --seed 7    # fresh process, args forwarded

A scene script may have a command line of its own (such as a Project calling run_cli()) so any argument this CLI does not recognise is forwarded to it, as is everything after --:

algan render project.py -q hd --render-video intro   # -q ours, --render-video the project's
algan render project.py -- --help                    # the project's help, not ours

Where both name the same thing, the script wins: -q sets the default preset, and a Project's own --video-settings (or its video_settings= argument) overrides it.

The warm render daemon

The first render of a session pays several seconds of library import plus Taichi kernel preparation. Algan pays that once: the first python scene.py starts a background daemon, and every later run hands its script to that warm process and starts rendering in about a second. Nothing is launched differently — it happens inside import algan.

algan daemon                # run one in this terminal (Enter re-renders, q quits)
algan daemon ping           # is one running?
algan daemon render         # re-render the last script (bind an editor key to it)
algan daemon quit           # stop it (algan daemon --stop is the same)

Those verbs each carry the token from the daemon's state file ($ALGAN_HOME/daemon.json, default ~/.algan), which is also where the port lives — the daemon prefers 46711 and falls back to an ephemeral port when it is taken.

A script served by the daemon runs in another process, and three things follow from that:

  • everything above import algan runs twice — once in your process, once in the daemon — so keep side effects below the import;
  • atexit handlers do not run, because the warm process never shuts down;
  • stdin is /dev/null, since the daemon's own stdin is its re-render trigger.

Everything else is reproduced: sys.argv, the working directory, the full environment, stdout/stderr (including from ffmpeg and other subprocesses), their tty-ness, and the exit code. ALGAN_USE_DAEMON=0 runs in-process, ALGAN_AUTO_DAEMON=0 only stops new ones being started, and a script being debugged is never handed off.


Documentation


License

Algan is licensed under the MIT License (see LICENSE). Copyright © Algorithmic Simplicity.

Download files

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

Source Distribution

algan-0.0.0.tar.gz (5.4 MB view details)

Uploaded Source

Built Distribution

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

algan-0.0.0-py3-none-any.whl (2.2 MB view details)

Uploaded Python 3

File details

Details for the file algan-0.0.0.tar.gz.

File metadata

  • Download URL: algan-0.0.0.tar.gz
  • Upload date:
  • Size: 5.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for algan-0.0.0.tar.gz
Algorithm Hash digest
SHA256 bc5a385a48568deee40d2838231fab7f6f95335d91cfea32b362f354bcac51f8
MD5 fbaed5535140b248aa76d883e0d5df7e
BLAKE2b-256 06aea686b39fe256e58d20c3085a7cb2eb12c13b7dca2950e43a3643cda20ac9

See more details on using hashes here.

Provenance

The following attestation bundles were made for algan-0.0.0.tar.gz:

Publisher: release.yaml on algorithmicsimplicity/algan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file algan-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: algan-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for algan-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd0b8c39f001625b5bb98537af9de835e07b6ff4c4a869113ed1a978e753951f
MD5 a03255974a7bb3008e3051789da6a889
BLAKE2b-256 5e3df4b27bc2ff402ea7bca2eb9762acb08434505dee041a53fef193b0cfba13

See more details on using hashes here.

Provenance

The following attestation bundles were made for algan-0.0.0-py3-none-any.whl:

Publisher: release.yaml on algorithmicsimplicity/algan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.0.2

2 files

0.0.1

2 files

This release

0.0.0 This release

2 files

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