Skip to main content

A utility for displaying image sequences as animations in Jupyter Notebooks.

Project description

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.

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

nbanim-0.1.4.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

nbanim-0.1.4-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file nbanim-0.1.4.tar.gz.

File metadata

  • Download URL: nbanim-0.1.4.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for nbanim-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6db214ebb72b2cd8f934130b0aacdf264c323af87600720ff879dc0ba91e68df
MD5 f9500700b08343226d26f57cb380ae62
BLAKE2b-256 a7977c8642269851dc05eea14fd70ddc02ba537eead2dc8176474ba51eb20652

See more details on using hashes here.

File details

Details for the file nbanim-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: nbanim-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for nbanim-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 da70746ec8056306ce29952e51bc7e1abc51abb23e32b1917fd38517787b0881
MD5 85862eaed6e0cb0f79922266912d3a44
BLAKE2b-256 fb1837460eef2a9e7147b1f8f100894198b36ddfe04e953dd3b2bd7f5d4dfdf7

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