Skip to main content

logo

MIT License PyPI Latest Release en Documentation Status

> English < | 简体中文

Introduction

JAnim is built around the core concept of programmatic animation to create precise and smooth animations. It supports real-time editing, live preview, and a wide range of other rich features.

Inspired by manim.

Introduction video: https://www.bilibili.com/video/BV17s42137SJ/

Examples

Highlights

Programmatic animation

class BubbleSort(Timeline):
    def construct(self):
        # define items
        heights = np.linspace(1.0, 6.0, 5)
        np.random.seed(123456)
        np.random.shuffle(heights)
        rects = [
            Rect(1, height,
                 fill_alpha=0.5)
            for height in heights
        ]

        group = Group(*rects)
        group.points.arrange(aligned_edge=DOWN)

        # do animations
        self.show(group)

        for i in range(len(heights) - 1, 0, -1):
            for j in range(i):
                rect1, rect2 = rects[j], rects[j + 1]

                self.play(
                    rect1.anim.color.set(BLUE),
                    rect2.anim.color.set(BLUE),
                    duration=0.15
                )

                if heights[j] > heights[j + 1]:
                    x1 = rect1.points.box.x
                    x2 = rect2.points.box.x

                    self.play(
                        rect1.anim.points.set_x(x2),
                        rect2.anim.points.set_x(x1),
                        duration=0.3
                    )

                    heights[[j, j + 1]] = heights[[j + 1, j]]
                    rects[j], rects[j + 1] = rect2, rect1

                self.play(
                    rect1.anim.color.set(WHITE),
                    rect2.anim.color.set(WHITE),
                    duration=0.15
                )

Change the code, refresh right away

Freely control the preview progress

Installation

JAnim runs on Python 3.12+

You may install JAnim directly via

pip install janim

to install the latest version distributed on PyPI.

To install the latest development version directly from the main branch without cloning the repository, you can run:

pip install git+https://github.com/jkjkil4/JAnim.git@main

Or, to catch up with the latest development and edit the source code, you may clone this repository and install it in editable mode:

git clone https://github.com/jkjkil4/JAnim.git
cd JAnim
pip install -e .

Using JAnim

You can run the following command to see examples.

janim examples

The Documentation provides a more detailed guide on installing and using JAnim. (Note: You can change the documentation language using the flyout menu at the corner of the page.)

JAnim's core dependencies:

  • janim-backend: Provides the Rust backend for JAnim
  • typst4janim: Used internally to export Typst elements directly to JAnim

License

MIT license

Metadata

Release files for janim 5.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for janim 5.0.2
File Size Uploaded Provenance Actions
janim-5.0.2.tar.gz 413.7 kB Without provenance Details for janim-5.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for janim 5.0.2
File Interpreter ABI Platform Actions
janim-5.0.2-py3-none-any.whl Python 3 none any Details for janim-5.0.2-py3-none-any.whl

Total release size: 973.7 kB

Release files / janim-5.0.2.tar.gz

Download URL janim-5.0.2.tar.gz
Size 413.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1d4573ef7f0e398aebe417b0290c6cfc079166753e4fe463d575a1bd93e74c1c
BLAKE2b-256 checksum
How to use checksums
37fb8c51537f92c01fea695e7e8f19908c1232163de9f9d6b5d9bbec13bf6d00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Release files / janim-5.0.2-py3-none-any.whl

Download URL janim-5.0.2-py3-none-any.whl
Size 559.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a6bb36c0679ed608c2abd7dea18a6ae119ccd9ce11e2feffb9620e282896cec
BLAKE2b-256 checksum
How to use checksums
8323e3fe3a814cd3089bc8a1b3d092b2704e9340473b731bac3cd9f3abcb5f9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Security for janim 5.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

5.0.2 This release

2 release files No provenance

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