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 Geometry Compatibility: A broad compatibility layer under algan.manim, with selected shapes also exported at the Algan root. Animation and rendering use Algan's own API; see compatibility boundaries.
  • 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.
  • 2D/3D Geometry and Transitions: Bézier circuits, meshes, parametric surfaces, and become() transitions between supported Mob types.
  • Audio & Speech Alignment: Automatic word-level forced alignment to synchronize on-screen animations with narration.

Installation

pip install algan

The core install is designed to use wheels on the supported platforms and Python versions (3.10–3.13). PyTorch and, on some platforms, its GPU libraries account for much of the installation size. Optional text, LaTeX and speech features have additional requirements; run algan check to inspect your setup.

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 the Manim compatibility layer's Pango-backed text classes are unavailable. Installing the extra builds the ManimPango Python binding, not Pango itself, and requires Pango's system libraries and development headers:

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

For eligible script runs, import algan starts or connects to a render daemon and hands the script to that warm process. This reuses library imports and compiled kernel variants across runs. New kernel variants and source changes can still require compilation; warm startup is not a fixed-time guarantee.

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.

The handoff forwards sys.argv, the working directory, the request environment, stdout/stderr (including subprocess output), terminal status and the exit code. Initialization-only settings cannot be changed in an already initialized process; incompatible requests are rejected with guidance to restart or bypass the daemon. See the environment contract. 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


Development status

See TODO.md for prioritized remaining work and AGENTS.md for the source layout and validation commands. Design documents and benchmark reports distinguish current contracts from historical proposals and measurements.

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.1.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.1-py3-none-any.whl (2.2 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: algan-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 b8e59f54434b09c2776bde915d3b2254f324e6789a20c3cf5436743c5844a662
MD5 537e0ccfacb34c8f8dedec5a21b9e399
BLAKE2b-256 136a73d1924e9a9e3ce5abb62d82271344e95a9bb769416458743b3f2b70bb73

See more details on using hashes here.

Provenance

The following attestation bundles were made for algan-0.0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: algan-0.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 44fdf23c105ab587a535f70681daf497b81a36947f92f9ae73d6e34e19cd58ac
MD5 4ceef0dc534a8e08fd99cbf0ceeec88a
BLAKE2b-256 8512072bf944f131772290f26a5e38c9aacb1bbcbb88fe876bbc7b019e65f9c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for algan-0.0.1-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

This release

0.0.1 This release

2 files

0.0.0

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