Record and replay every step of your plotting process
Project description
snaplot: Record and replay every step of your plotting process
snaplot is a Python package here to help your record your plotting process, without having to think about it!
It's highly inspired by {camcorder}, an R package that does pretty much the same thing. If you're an R user, check it out!
Why?
By nature, data visualization is an iterative process: no one creates the final, perfectly polished version of a graph on the first try. It always takes plenty of trial and error.
Interestingly, visualizing this process can be quite insightful. That's where snaplot comes in.
How to use?
snaplot provides a single class (Camera) and is designed to be as easy-to-use as possible.
import matplotlib.pyplot as plt
from snaplot import Camera
camera = Camera.start("my_movie")
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [1, 2, 3]) # first chart
camera.snap()
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [4, 2, 3], color="red") # second chart
camera.snap()
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [1, 5, 3], color="green", lw=3) # third chart
camera.snap()
fig, ax = plt.subplots()
ax.plot([5, 2, 4], [2, 3, 3], color="blue", lw=6) # fourth chart
camera.snap()
# GIF with 4 images, 300ms/image
camera.stop("my_file.gif", frame_duration=300)
In short:
- you initiate a camera with
camera = Camera.start() - you take snapshots with
camera.snap() - you save your video with
camera.stop()
For more info, check out the reference page
Installation
pip install snaplot
Some cool things
- You can run
Camera.start()multiple times with the same id without forgetting previouscamera.snap(). Unless you setforce_new=True, it will automatically recognize that you're still recording. - Even after calling
camera.stop("file.gif"), you can keep recording. If you want to save the intermediate GIF, just use a different filename likecamera.stop("file2.gif"). - It works with any matplotlib-based plotting library: seaborn, plotnine, etc
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file snaplot-0.2.2.tar.gz.
File metadata
- Download URL: snaplot-0.2.2.tar.gz
- Upload date:
- Size: 23.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
178111e1f64696e13a02a9cdc8871de750b1e61fe4b94926a0eea23a5426ac0f
|
|
| MD5 |
418743dc0fdb2329bac260677e1c223c
|
|
| BLAKE2b-256 |
e9aa5b4ee46864ee8069556e387cef14a35f5bdf3446f25a964b623521e41359
|
Provenance
The following attestation bundles were made for snaplot-0.2.2.tar.gz:
Publisher:
pypi.yaml on y-sunflower/snaplot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snaplot-0.2.2.tar.gz -
Subject digest:
178111e1f64696e13a02a9cdc8871de750b1e61fe4b94926a0eea23a5426ac0f - Sigstore transparency entry: 648524150
- Sigstore integration time:
-
Permalink:
y-sunflower/snaplot@21556024db4c5e481ca983232c2975f7403aa521 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/y-sunflower
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@21556024db4c5e481ca983232c2975f7403aa521 -
Trigger Event:
push
-
Statement type:
File details
Details for the file snaplot-0.2.2-py3-none-any.whl.
File metadata
- Download URL: snaplot-0.2.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92333afa1dff75b450c1a348d0e8a765f9276542243d7cd6785c89b56b8509cd
|
|
| MD5 |
5b162966be5911dfad795d066335913b
|
|
| BLAKE2b-256 |
bab904690f1e7d135e8b6bdaa5687ef73c8a32be26b185b22f02b3ff8ba96a6a
|
Provenance
The following attestation bundles were made for snaplot-0.2.2-py3-none-any.whl:
Publisher:
pypi.yaml on y-sunflower/snaplot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snaplot-0.2.2-py3-none-any.whl -
Subject digest:
92333afa1dff75b450c1a348d0e8a765f9276542243d7cd6785c89b56b8509cd - Sigstore transparency entry: 648524153
- Sigstore integration time:
-
Permalink:
y-sunflower/snaplot@21556024db4c5e481ca983232c2975f7403aa521 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/y-sunflower
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@21556024db4c5e481ca983232c2975f7403aa521 -
Trigger Event:
push
-
Statement type: