ez-animate
A high-level, declarative Python package for creating common Matplotlib animations with minimal boilerplate code.
Project Goals
ez-animate
aims to make it easy for data scientists, analysts, educators, and researchers to create standard Matplotlib animations quickly and with minimal code. It abstracts away the complexity of FuncAnimation
, state management, and repetitive setup, letting you focus on your data and story.
Why?
- Complex Setup: No need to write custom
init
and update
functions.
- State Management: Simplifies handling data and artist states between frames.
- Repetitive Code: Reduces boilerplate for standard animations.
Who is it for?
- Primary: Data scientists & analysts (exploratory analysis, presentations, notebooks)
- Secondary: Students, educators, and researchers (learning, teaching, publications)
Features
- Simple API: Create animations with a few lines of code
- Tested & Linted: High code quality with
pytest
and ruff
- Documentation: Built with MkDocs (TBD)
Installation
Pending PyPI release. For now, install directly from GitHub
pip install ez-animate
Quickstart
from ez_animate import RegressionAnimation
animator = RegressionAnimation(
model=Lasso,
X=X,
y=y,
test_size=0.25,
dynamic_parameter="alpha",
static_parameters={"max_iter": 1, "fit_intercept": True},
keep_previous=True,
metric_fn=Metrics.mean_squared_error,
)
animator.setup_plot(
title="Regression Animation",
xlabel="Feature Coefficient",
ylabel="Target Value",
)
animator.animate(frames=np.arange(0.01, 1.0, 0.01))
animator.show()
animator.save("regression_animation.gif")
Full Documentation
See the documentation site for complete usage instructions, API references, and examples.
Development/Contributing
See DEVELOPMENT.md for full development and contributing guidelines.
Project Structure
ez-animate/
├─ .github/
│ ├─ ISSUE_TEMPLATE
│ └─ workflows
├─ examples/
│ ├─ plots
│ ├─ sega_learn
│ └─ sklearn
├─ src/
│ └─ ez_animate
└─ tests
License
This project is licensed under the terms of the MIT License.
Dependency Management
- All dependencies are in
pyproject.toml
.
- Core:
[project.dependencies]
- Other:
[project.optional-dependencies]
- Use
uv pip install -e .[dev]
to install all dev tools.
Acknowledgments
- Built with inspiration from the Matplotlib community.
- Thanks to all contributors!