A community-maintained Python framework for creating mathematical animations. https://www.manim.community
  • Python 98.2%
  • GLSL 1.6%
  • Dockerfile 0.1%
Find a file
Aarush Deshpande e74933049e
Add support for Python 3.13 (#3967)
* Allow python 3.13

* Specify scipy more strictly

* try using 3rd-party audioop package

* debug: wrap context generation in try-block

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove audioop-lts, update dependencies

* add wrapt pre-release (wheels!)

* update lockfile

* CI, windows: try installing all tinytex packages at once

* tmp: verbosity of pytest

* tmp: pass -n 0 for testing

* tmp: disable pytest-xdist

* remove deprecated poetry installer option

* try running tests via uv-provided env

* tmp: run -> run --no-project

* try --full-trace

* try running tests via python -v ...

* tmp: test import of suspicious modules

* test click/cloup

* ci: back to poetry

* ci: disable pytest plugins altogether

* update lockfile

* ci: upgrade pytest

* remove all flags from pytest call

* ci: move conftest, temporarily disable test header

* fix test fixture

* try with more recent version of pytest-xdist

* loadfile -> loadscope

* explicitly test pytest for non-manim module

* some proper tests

* only keep fixtures in new conftest.py

* remove all non-necessary fixtures

* try a literal try/except in fixture file

* simplify tests further

* try and explicitly trigger non-silent errors

* Revert "try and explicitly trigger non-silent errors"

This reverts commit 35b862d483.

* more pytest debug output

* test whether manim can be imported correctly

* test with upgraded numpy

* revert all sorts of debug changes, attempt clean pytest run

* fix whitespace

* pre-commit hooks

* apply config fixture to render tests

* let config fixture ensure renderer is set to cairo

* update doctests for numpy>=2.0

* missed some

* upgrade required numpy version, revert separate treatment of numpy in ci

* upgraded moderngl-window to latest

* more delicate versioning of numpy dependency

---------

Co-authored-by: Benjamin Hackl <devel@benjamin-hackl.at>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-02 08:50:14 +01:00
.github Add support for Python 3.13 (#3967) 2024-12-02 08:50:14 +01:00
docker Update docker to use ENV x=y instead of ENV x y (#3858) 2024-07-14 21:13:26 +02:00
docs Add type hints to manim.cli module (#3988) 2024-11-04 16:05:07 +00:00
example_scenes Use Ruff pygrep rules (#3923) 2024-09-01 17:55:22 +02:00
logo resize svgs: fit content to canvas (#2344) 2021-12-01 07:28:20 +00:00
manim Add support for Python 3.13 (#3967) 2024-12-02 08:50:14 +01:00
scripts os.system -> subprocess (#3955) 2024-10-15 20:43:02 -03:00
tests Add support for Python 3.13 (#3967) 2024-12-02 08:50:14 +01:00
.codecov.yml added .codecov.yml (#1187) 2021-03-28 11:17:06 +02:00
.codespell_ignorewords [pre-commit.ci] pre-commit autoupdate (#3332) 2024-04-24 13:11:03 +02:00
.codespellrc [pre-commit.ci] pre-commit autoupdate (#3332) 2024-04-24 13:11:03 +02:00
.dockerignore Post-release update for docker readme (#815) 2020-12-03 16:26:52 +05:30
.flake8 [pre-commit.ci] pre-commit autoupdate (#3332) 2024-04-24 13:11:03 +02:00
.git-blame-ignore-revs Ignore Ruff format in git blame (#3781) 2024-05-22 13:32:50 -04:00
.gitattributes Flake8 Changes + Fixing Warnings (#1968) 2021-09-03 13:45:48 -04:00
.gitignore Fix tests to run on Cairo 1.18.0 (#3416) 2023-10-25 21:54:45 +02:00
.pre-commit-config.yaml [pre-commit.ci] pre-commit autoupdate (#3987) 2024-11-24 12:59:04 +01:00
.pylintrc Adding spell checker as a pre-commit hook (#1544) 2021-05-21 15:43:31 +05:30
.readthedocs.yml Let SceneFileWriter access ffmpeg via av instead of via external process (#3501) 2024-05-15 13:23:09 +00:00
CITATION.cff Prepare new release: v0.18.1 (#3719) 2024-04-28 09:02:22 +00:00
CODE_OF_CONDUCT.md Fix minor typing mistakes in docs (#2485) 2022-01-26 10:59:32 +00:00
CONTRIBUTING.md Create CONTRIBUTING.md (#1460) 2021-05-04 11:52:36 +05:30
crowdin.yml Added Crowdin configuration and changed source files to `.pot` format (#2165) 2021-10-15 11:51:09 +02:00
lgtm.yml LGTM Error Fix (#2001) 2021-09-28 22:00:53 +00:00
LICENSE add community license as separate from 3b1b original license 2020-05-29 21:15:43 -04:00
LICENSE.community fix(LICENSE): update year (#3689) 2024-04-11 17:57:55 +02:00
mypy.ini Add typings to manim/__main__.py (#4007) 2024-11-13 22:16:17 +00:00
poetry.lock Add support for Python 3.13 (#3967) 2024-12-02 08:50:14 +01:00
pyproject.toml Add support for Python 3.13 (#3967) 2024-12-02 08:50:14 +01:00
README.md Use Github Markdown on README (#3925) 2024-10-20 00:24:14 +02:00



PyPI Latest Release Docker image MIT License Reddit Twitter Discord Code style: black Documentation Status Downloads CI

An animation engine for explanatory math videos


Manim is an animation engine for explanatory math videos. It's used to create precise animations programmatically, as demonstrated in the videos of 3Blue1Brown.

Note

This repository is maintained by the Manim Community and is not associated with Grant Sanderson or 3Blue1Brown in any way (although we are definitely indebted to him for providing his work to the world). If you would like to study how Grant makes his videos, head over to his repository (3b1b/manim). This fork is updated more frequently than his, and it's recommended to use this fork if you'd like to use Manim for your own projects.

Table of Contents:

Installation

Caution

These instructions are for the community version only. Trying to use these instructions to install 3b1b/manim or instructions there to install this version will cause problems. Read this and decide which version you wish to install, then only follow the instructions for your desired version.

Manim requires a few dependencies that must be installed prior to using it. If you want to try it out first before installing it locally, you can do so in our online Jupyter environment.

For local installation, please visit the Documentation and follow the appropriate instructions for your operating system.

Usage

Manim is an extremely versatile package. The following is an example Scene you can construct:

from manim import *


class SquareToCircle(Scene):
    def construct(self):
        circle = Circle()
        square = Square()
        square.flip(RIGHT)
        square.rotate(-3 * TAU / 8)
        circle.set_fill(PINK, opacity=0.5)

        self.play(Create(square))
        self.play(Transform(square, circle))
        self.play(FadeOut(square))

In order to view the output of this scene, save the code in a file called example.py. Then, run the following in a terminal window:

manim -p -ql example.py SquareToCircle

You should see your native video player program pop up and play a simple scene in which a square is transformed into a circle. You may find some more simple examples within this GitHub repository. You can also visit the official gallery for more advanced examples.

Manim also ships with a %%manim IPython magic which allows to use it conveniently in JupyterLab (as well as classic Jupyter) notebooks. See the corresponding documentation for some guidance and try it out online.

Command line arguments

The general usage of Manim is as follows:

manim-illustration

The -p flag in the command above is for previewing, meaning the video file will automatically open when it is done rendering. The -ql flag is for a faster rendering at a lower quality.

Some other useful flags include:

  • -s to skip to the end and just show the final frame.
  • -n <number> to skip ahead to the n'th animation of a scene.
  • -f show the file in the file browser.

For a thorough list of command line arguments, visit the documentation.

Documentation

Documentation is in progress at ReadTheDocs.

Docker

The community also maintains a docker image (manimcommunity/manim), which can be found on DockerHub. Instructions on how to install and use it can be found in our documentation.

Help with Manim

If you need help installing or using Manim, feel free to reach out to our Discord Server or Reddit Community. If you would like to submit a bug report or feature request, please open an issue.

Contributing

Contributions to Manim are always welcome. In particular, there is a dire need for tests and documentation. For contribution guidelines, please see the documentation.

However, please note that Manim is currently undergoing a major refactor. In general, contributions implementing new features will not be accepted in this period. The contribution guide may become outdated quickly; we highly recommend joining our Discord server to discuss any potential contributions and keep up to date with the latest developments.

Most developers on the project use poetry for management. You'll want to have poetry installed and available in your environment. Learn more about poetry at its documentation and find out how to install manim with poetry at the manim dev-installation guide in the manim documentation.

How to Cite Manim

We acknowledge the importance of good software to support research, and we note that research becomes more valuable when it is communicated effectively. To demonstrate the value of Manim, we ask that you cite Manim in your work. Currently, the best way to cite Manim is to go to our repository page (if you aren't already) and click the "cite this repository" button on the right sidebar. This will generate a citation in your preferred format, and will also integrate well with citation managers.

Code of Conduct

Our full code of conduct, and how we enforce it, can be read on our website.

License

The software is double-licensed under the MIT license, with copyright by 3blue1brown LLC (see LICENSE), and copyright by Manim Community Developers (see LICENSE.community).