Skip to main content

A template project to both illustrate and serve as an example for plugin creations on top of the manim (community edition) engine.

Project description

This is a template project that demonstrates how one can create and upload a manim plugin to PyPI using a PEP 517 compliant build system (in this case poetry). This build system ensures users of your plugin are able to do so reliably without without falling into dependency hell. You may use another build system other than poetry (e.g. Flit, Enscons, etc…) if you wish to.

Creating Plugins

Plugins are features that can be used to extend the core of Manim’s functionality. By convention, plugins should be prefixed by manim- when being named. This allows users to easily search for plugins on organizations like PyPi, but it is not required. Manim discovers user plugins via the metadata specified in the pyproject.toml.

Installing Poetry

Poetry can be installed on any OS that can has curl. Please visit the official poetry website for installation instructions.

Setting Up Your Plugin Directory Structure

To create a Python project suitable for poetry you may want to see the official documentation for a list of all available commands. In short, if you haven’t extended manim’s functionality yet, run:

poetry new --src manim-YourPluginName

Note: --src is both optional and recomended in order to create a src directory where all of your plugin code should live.

This will create the following project structure:

manim-YourPluginName
├── pyproject.toml
├── README.rst
├── src
│   └── manim_yourpluginname
│       └── __init__.py
└── tests
    ├── __init__.py
    └── test_manim_yourpluginname.py

If you have already extended manim’s functionality, you can instead run:

cd path/to/plugin
poetry init

This will prompt you for basic information regarding your plugin and help create and populate a pyproject.toml similar to the one in this template.

See the official documentation for more information on the init command.

Updating Pyproject.toml

The pyproject.toml file is used by poetry and other build systems to manage and configure your project. Manim uses the package’s entry point metadata to discover available plugins. The entry point, "manim.plugins", is REQUIRED and can be specified as follows:

[tool.poetry.plugins."manim.plugins"]
"manim_yourpluginname" = "manim_yourpluginname"

This allows Manim to discover your plugin via manim plugin -u

Testing Your Plugin Locally

poetry install

This command will read the pyproject.toml, install the dependencies of your plugin, and create a poetry.lock file to ensure everyone using your plugin gets the same version of dependencies. It is important that your dependencies are properly annotated with a version constraint (e.g. manim:^0.1.1, numpy:1.19.2, etc…). Equally important to the dependencies specified here is that they do not conflict with manim’s.

See the official documentation for more information on versioning or the install command.

Uploading Your Project

By default, poetry is set to register the package/plugin to pypi. As soon as your plugin is useful locally, run the following:

poetry publish --build

Your project should now be available on PyPI for users to install via pip install manim-YourPluginName and usable within their respective environments.

See the official documentation for more information on the publish command.

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

manim-PluginTemplate-0.1.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

manim_PluginTemplate-0.1.3-py2.py3-none-any.whl (4.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file manim-PluginTemplate-0.1.3.tar.gz.

File metadata

  • Download URL: manim-PluginTemplate-0.1.3.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.0 Windows/10

File hashes

Hashes for manim-PluginTemplate-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5492794db3200a40e7947e04208af7da380389e03c1db2ad232964178ad387e9
MD5 77584e65ea998c79f95d0bf90fc2207d
BLAKE2b-256 47aed8a5656978fc9a068e386ed514ff0507aec7a1bf58168f42381df783fb04

See more details on using hashes here.

File details

Details for the file manim_PluginTemplate-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for manim_PluginTemplate-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e210357c25f73db44a0c2fb2e04ca13b7f2919226f651d042a0f733b0b74a276
MD5 b06cd869165e045bf05c2e7ed67c446f
BLAKE2b-256 93f334d20355f1b75bd2f87a8b6feb329356675c6fc480515405d4a988d29174

See more details on using hashes here.

Supported by

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