{"id":15043305,"url":"https://github.com/open-atmos/jupyter-utils","last_synced_at":"2025-07-04T17:33:36.510Z","repository":{"id":37003354,"uuid":"407290472","full_name":"open-atmos/jupyter-utils","owner":"open-atmos","description":"utility routines for embedding vector graphics and animations in Python Jupyter notebooks using matplotlib (with focus on testing and Colab \u0026 GitHub compatibility)","archived":false,"fork":false,"pushed_at":"2025-02-04T07:20:16.000Z","size":822,"stargazers_count":4,"open_issues_count":9,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T21:13:05.245Z","etag":null,"topics":["animations","colab","jupyter-notebook","matplotlib","pip","pypi-package","python","testing","vector-graphics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-atmos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-16T19:28:51.000Z","updated_at":"2025-04-06T18:31:34.000Z","dependencies_parsed_at":"2024-05-31T00:27:57.895Z","dependency_job_id":null,"html_url":"https://github.com/open-atmos/jupyter-utils","commit_stats":{"total_commits":33,"total_committers":1,"mean_commits":33.0,"dds":0.0,"last_synced_commit":"f30a5889f26565c4dd501ba89e1b0d4c2a8dd31e"},"previous_names":["atmos-cloud-sim-uj/utils"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-atmos%2Fjupyter-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-atmos%2Fjupyter-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-atmos%2Fjupyter-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-atmos%2Fjupyter-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-atmos","download_url":"https://codeload.github.com/open-atmos/jupyter-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248961237,"owners_count":21189993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animations","colab","jupyter-notebook","matplotlib","pip","pypi-package","python","testing","vector-graphics"],"created_at":"2024-09-24T20:48:50.094Z","updated_at":"2025-04-14T21:13:12.113Z","avatar_url":"https://github.com/open-atmos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# open-atmos-jupyter-utils\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)\n[![tests](https://github.com/open-atmos/jupyter-utils/actions/workflows/tests.yml/badge.svg)](https://github.com/open-atmos/jupyter-utils/actions/workflows/tests.yml)\n[![PyPI version](https://badge.fury.io/py/open-atmos-jupyter-utils.svg)](https://pypi.org/project/open-atmos-jupyter-utils)\n[![Github repo](https://img.shields.io/badge/jupyter--utils-code_repository-gold?logo=github)](https://github.com/open-atmos/jupyter-utils)\n\n## Features\n\n`open-atmos-jupyter-utils` is a Python package providing Jupyter notebook utility routines \nfor:\n- presenting [matplotlib](https://matplotlib.org) plots as either SVG vector graphics or animated GIFs, embedding them within the notebooks, and rendering correctly in [GitHub's Rich Jupyter Notebook diffs](https://github.blog/changelog/2023-03-01-feature-preview-rich-jupyter-notebook-diffs/)\n- save-as buttons below each figure (triggering [Google-Drive downloads](https://colab.research.google.com/notebooks/io.ipynb#scrollTo=hauvGV4hV-Mh) on [Colab](https://colab.google/))\n- execution of unmodified notebook code for automated testing (e.g., within [pytest fixtures](https://docs.pytest.org/en/stable/explanation/fixtures.html))\n- pip-installation of external packages on Colab safeguarded against [alterations of Google-shipped packages](https://github.com/googlecolab/colabtools/issues/2837)\n\n## Functions and Examples\n- [``show_plot()``](https://open-atmos.github.io/jupyter-utils/open_atmos_jupyter_utils/show_plot.html) - a drop-in replacement for matplotlib.pyplot.show() that displays figures inline as SVG vector graphics. The function also provides a download widget that allows users to download the figure as PDF or SVG. On Google Colab, the widget triggers a Google Drive download. Example:   \n  [![preview notebook](https://img.shields.io/static/v1?label=render%20on\u0026logo=github\u0026color=87ce3e\u0026message=GitHub)](https://github.com/open-atmos/jupyter-utils/blob/main/examples/show_plot.ipynb)\n  [![launch on mybinder.org](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/jupyter-utils.git/main?urlpath=lab/tree/examples/show_plot.ipynb)\n  [![launch on Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/jupyter-utils/blob/main/examples/show_plot.ipynb)\n- [``show_anim(plot_func: typing.Callable, frame_range: typing.Iterable)``](https://open-atmos.github.io/jupyter-utils/open_atmos_jupyter_utils/show_anim.html) - a replacement for matplotlib.animation.FuncAnimation that displays inline animations in GIF format (which is compatible with GitHub rendering). It also provides a download widget to save the animation as a GIF file, with Colab support for Google Drive download. Example:  \n  [![preview notebook](https://img.shields.io/static/v1?label=render%20on\u0026logo=github\u0026color=87ce3e\u0026message=GitHub)](https://github.com/open-atmos/jupyter-utils/blob/main/examples/show_anim.ipynb)\n  [![launch on mybinder.org](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/jupyter-utils.git/main?urlpath=lab/tree/examples/show_anim.ipynb)\n  [![launch on Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/jupyter-utils/blob/main/examples/show_anim.ipynb)\n- [``notebook_vars(notebook: pathlib.Path, plot: bool)``](https://open-atmos.github.io/jupyter-utils/open_atmos_jupyter_utils/notebook_vars) - a function that executes notebook code and returns a dictionary of variables present in the notebook. This is particularly useful for setting up automated tests using pytest fixtures without any modification to the original notebooks. The `plot` flag controls if `show_plot()` calls within the notebook should be run or not. Example:   \n    [![view test](https://img.shields.io/static/v1?label=view%20on\u0026logo=github\u0026color=87ce3e\u0026message=GitHub)](https://github.com/open-atmos/jupyter-utils/blob/main/tests/test_notebook_vars.py)\n- [``pip_install_on_colab('package_a', 'package_b', ...)``](https://open-atmos.github.io/jupyter-utils/open_atmos_jupyter_utils/pip_install_on_colab.html) - a function that automates the installation of Python packages in Colab environments via pip (and ldconfig for system libraries). This ensures smooth setup for notebooks running on Colab.\n\n## Usage\nFor installation use:\n```bash\npip install open-atmos-jupyter-utils\n```\nThen import inside Python project\n```Python\nimport open_atmos_jupyter_utils as oaju\n```\n\n## Documentation\nPublic API docs are maintained at: https://open-atmos.github.io/jupyter-utils/\n\n\n## Use Cases\nopen-atmos-jupyter-utils has been developed for and used in numerous Jupyter\nnotebooks in [PySDM](https://github.com/open-atmos/PySDM), [PyMPDATA](https://github.com/open-atmos/PyMPDATA) and [PyPartMC](https://github.com/open-atmos/PyPartMC) projects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-atmos%2Fjupyter-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-atmos%2Fjupyter-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-atmos%2Fjupyter-utils/lists"}