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-20240727162435.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-20240727162435-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nbanim-20240727162435.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-20240727162435.tar.gz
Algorithm Hash digest
SHA256 97a54e298411436d86d641f38c0ffe4ddcc75e364d37b8070ecf5b1278d63493
MD5 89e4923ecdb5457c577f98937b3fa481
BLAKE2b-256 8c89837d8a4ad0e351b91ee8b1b34a36e26e19e4ccfb91389026c1eefc00c7ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nbanim-20240727162435-py3-none-any.whl
Algorithm Hash digest
SHA256 d508c86e848c1ce9de259535a74bdc974dd5e0ae932e40ef8644d69ce7e75588
MD5 6c1aa5186daba73004ef73cce0117547
BLAKE2b-256 1b7fdb94a6f8a87899101283fdef83b89b805c2efa1b47aea6a763a9b93da778

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