Skip to main content

A Vector-Graphics-Based Animation Library

Project description

Visuscript

Visuscript is a two-dimensional vector-graphics-based animation library for Python, inspired by manim. Visuscript is designed to facilitate the creation of didactic animations for computer-science principles.

⚠️ STABILITY WARNING ⚠️

This library is currently in early development and is subject to rapid, breaking changes. APIs, features, and internal structures may change without prior notice. It is not yet recommended for production use. Please use with caution and expect frequent updates that may require adjustments to your code.

Features

  • Create arbitrary 2D graphics with Drawing and Path.
  • Create arbitrary animations by composing primative Animation objects with AnimationBundle and AnimationSequence.
  • Represent and animate datastructures with AnimatedCollection inheritors.
  • Runtime checks for conflicting animations or updaters with PropertyLocker.
  • (In my opinion) A cleaner API than manim.

Getting Started

Since Visuscript is still in development and the API is changing, the documentation is incomplete as of now. I will try my best to keep a small set of working examples through these changes in examples/.

I shall now walk you through setup/installation and the creation of a very basic animation.

I have tested this package with Python 3.13.3.

External Dependencies

ffmpeg and librsvg must be installed. You should be able to download these through a package manager. To download with Homebrew, use

brew install ffmpeg
brew install librsvg

Both of these utilities' executables must be in PATH and have names ffmpeg and rsvg-convert.

Package Installation

To install Visuscript, run the following in the root directory of this repository, the directory with setup.py therein:

pip install -e . 

This will install the Visuscript package alongisde its dependencies and the visuscript CLI utility. The utility should be added to PATH automatically when the package is installed. If not, you can find the script for the CLI at root/visuscript/cli/visuscript_cli.py.

Hello, World!

For your first visuscript, create a file called hello_world.py and place the following in it:

from visuscript import *
with Scene() as s:
    s << Text("Hello, World!")

To run this visuscript, run

visuscript hello_world.py

This will create a new mp4 file called output.mp4, which should be a very boring one frame video with a dark background and text in Arial typeface displaying one of the ancientmost of coding rituals of initiation.

Let us now modify this visuscript to include some animation. Update the file to contain the following and you will get color-changing, rotating, and moving text:

from visuscript import *
with Scene() as s:
    text = Text("Hello, World!")
    s << text
    s.animations << AnimationSequence(
        RgbAnimation(text.fill, 'red'),
        RgbAnimation.lazy(text.fill, 'white'),
        RgbAnimation.lazy(text.fill, 'blue'),
        )
    s.animations << TransformAnimation(text.transform, Transform(
        translation=[100,-30],
        rotation=360,
        scale=2,
    ), duration = 3)

What next?

Pending the stability of the API and thus the documentation, please refer to the provided examples for further learning.

Future

I plan on seeing this project through to something useful for creating didactic animations. I want to have a library with comparable expressiveness to manim for two-dimensional use-cases. Specifically, Visuscript is planned to have, as time may permit,

  • Robust error checking.
  • Clear and complete documentation.
  • Base classes for common datastructures to facilitate the animation thereof.
  • Abstractions for mathematical objects like cartesian planes.

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

visuscript-0.1.0a1.tar.gz (703.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

visuscript-0.1.0a1-py3-none-any.whl (713.9 kB view details)

Uploaded Python 3

File details

Details for the file visuscript-0.1.0a1.tar.gz.

File metadata

  • Download URL: visuscript-0.1.0a1.tar.gz
  • Upload date:
  • Size: 703.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for visuscript-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 8bfded1073f2bfa755710edbe0cac4cc341243c1dac26b67dcaacfb76d697d68
MD5 829644316671c57385e215d6212afaab
BLAKE2b-256 a258009427ca038bf9e82fc969e4487b47a619127e94bf5cf4afc6be867f2c9d

See more details on using hashes here.

File details

Details for the file visuscript-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: visuscript-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 713.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for visuscript-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff4877201765b377bfd98a61dfb3e1e37c2b37eee9dc1f541121592bb33bcb98
MD5 37f06d3fc50ac854a14ce5a2d58b93c5
BLAKE2b-256 430e1715735ff60beedd18e3d2e2cb5858f8185af77e5c6c36b48b568dcf3de8

See more details on using hashes here.

Supported by

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