Skip to main content

NBAnim

NBAnim is a Python utility designed to display image sequences as animations within a Jupyter Notebook. It provides a simple interface to control the playback of image sequences, including play, pause, stop, and adjust the animation speed, making it ideal for visual demonstrations and presentations.

Features

  • Play, pause, and stop animations.
  • Navigate through image frames with next and previous controls.
  • Adjust animation speed dynamically.
  • Easy integration with Jupyter Notebooks.

Installation

NBAnim can be installed using pip, by cloning the repository, or directly from GitHub. Below are instructions for each method:

Using pip

To install NBAnim directly using pip, execute the following command in your terminal:

pip install nbanim

Cloning the Repository

If you prefer to install NBAnim by cloning the repository, first ensure you have git installed on your system. Then, run the following command:

git clone https://github.com/syedhamidali/nbanim.git
cd nbanim
pip install .

This will clone the repository to your local machine and install it using pip.

Directly from GitHub

You can also install the latest version of NBAnim directly from GitHub using pip:

pip install git+https://github.com/syedhamidali/nbanim.git

This method is useful if you want to install the very latest version that may include changes not yet published to PyPI.

Requirements

NBAnim requires the following to run:

  • Python 3.6+
  • IPython
  • ipywidgets

Please make sure you have these requirements installed before installing NBAnim.

Example Usage 1

Here is a simple example of how to use NBAnim to display an animation in a Jupyter Notebook:

from nbanim import NBAnim

# List of image file paths for the frames of your animation
frames = ['path/to/frame1.png', 'path/to/frame2.png', 'path/to/frame3.png']

# Create an instance of NBAnim with the frames and optionally set the animation speed
anim = NBAnim(frames, animation_speed=0.5)

Example Usage 2

import glob
from nbanim import NBAnim

# List of image file paths for the frames of your animation
frames = sorted(glob.glob("~/Downloads/*png"))

# Create an instance of NBAnim with the frames and optionally set the animation speed
anim = NBAnim(frames, animation_speed=0.5)

The animation controls will be displayed automatically in the Jupyter Notebook

In this example, replace 'path/to/frame1.png', 'path/to/frame2.png', and 'path/to/frame3.png' with the actual paths to your image files. The NBAnim class takes care of displaying the images and providing a user interface for controlling the animation directly within the notebook.

Metadata

Release files for nbanim 0.1.4

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

Source distribution (sdist)

Source distribution for nbanim 0.1.4
File Size Uploaded
nbanim-0.1.4.tar.gz 4.1 kB Details

Built distribution (wheel)

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

Total release size: 8.3 kB

Release files / nbanim-0.1.4.tar.gz

Download URL nbanim-0.1.4.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6db214ebb72b2cd8f934130b0aacdf264c323af87600720ff879dc0ba91e68df
BLAKE2b-256 checksum
How to use checksums
a7977c8642269851dc05eea14fd70ddc02ba537eead2dc8176474ba51eb20652
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / nbanim-0.1.4-py3-none-any.whl

Download URL nbanim-0.1.4-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da70746ec8056306ce29952e51bc7e1abc51abb23e32b1917fd38517787b0881
BLAKE2b-256 checksum
How to use checksums
fb1837460eef2a9e7147b1f8f100894198b36ddfe04e953dd3b2bd7f5d4dfdf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.1

2 release files

0.1.0

2 release 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