Algan
Full-featured 2D/3D programmatic animation engine for explanatory mathematics and technical videos.
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(), andSpeech()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 alganruns twice — once in your process, once in the daemon — so keep side effects below the import; atexithandlers do not run, because the warm process never shuts down;stdinis/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
- Documentation: https://algorithmicsimplicity.github.io/algan
- Tutorials: New User Tutorials
- Discord Community: Join our Discord
- Issue Tracker: GitHub Issues
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc5a385a48568deee40d2838231fab7f6f95335d91cfea32b362f354bcac51f8
|
|
| MD5 |
fbaed5535140b248aa76d883e0d5df7e
|
|
| BLAKE2b-256 |
06aea686b39fe256e58d20c3085a7cb2eb12c13b7dca2950e43a3643cda20ac9
|
Provenance
The following attestation bundles were made for algan-0.0.0.tar.gz:
Publisher:
release.yaml on algorithmicsimplicity/algan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
algan-0.0.0.tar.gz -
Subject digest:
bc5a385a48568deee40d2838231fab7f6f95335d91cfea32b362f354bcac51f8 - Sigstore transparency entry: 2768201145
- Sigstore integration time:
-
Permalink:
algorithmicsimplicity/algan@f10cc230a108863d02980fc27079254473ae7de3 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/algorithmicsimplicity
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@f10cc230a108863d02980fc27079254473ae7de3 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd0b8c39f001625b5bb98537af9de835e07b6ff4c4a869113ed1a978e753951f
|
|
| MD5 |
a03255974a7bb3008e3051789da6a889
|
|
| BLAKE2b-256 |
5e3df4b27bc2ff402ea7bca2eb9762acb08434505dee041a53fef193b0cfba13
|
Provenance
The following attestation bundles were made for algan-0.0.0-py3-none-any.whl:
Publisher:
release.yaml on algorithmicsimplicity/algan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
algan-0.0.0-py3-none-any.whl -
Subject digest:
dd0b8c39f001625b5bb98537af9de835e07b6ff4c4a869113ed1a978e753951f - Sigstore transparency entry: 2768201241
- Sigstore integration time:
-
Permalink:
algorithmicsimplicity/algan@f10cc230a108863d02980fc27079254473ae7de3 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/algorithmicsimplicity
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@f10cc230a108863d02980fc27079254473ae7de3 -
Trigger Event:
workflow_dispatch
-
Statement type: