ipynbname
Simply returns either notebook filename or the full path to the notebook when run from Jupyter notebook in browser.
What it is and what it does
ipynbname solves a surprisingly difficult problem: getting the filename or full path of the notebook you're currently running in Jupyter. When executed in a browser-based notebook, it queries the Jupyter kernel to retrieve this metadata, which is not otherwise easily accessible from within the notebook itself. The package exposes two main functions—name() to get just the filename and path() to get the full file path—making it straightforward to automate workflows that depend on knowing which notebook is running.
The package was originally created to automate publishing blog posts written in Jupyter notebooks directly to GitHub Pages. It has a single runtime dependency on ipykernel and requires Python >=3.4. The main limitation is that it only works reliably in browser-based Jupyter notebooks; it does not currently work with nbconvert or papermill.
Use it for:
- Automating blog post publishing workflows by detecting which notebook is being converted and routing it to the correct destination.
- Logging or tracking which notebook generated a particular output or result in a data analysis pipeline.
- Dynamically naming output files or directories based on the source notebook filename without manual configuration.
- Building notebook-aware automation that needs to know its own filename for reproducibility or audit purposes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Returns the filename or full path of the currently running Jupyter notebook when executed in a browser-based notebook environment.
Yes, if you need to programmatically access the current notebook's filename or path within a browser-based Jupyter environment. The low install friction and permissive MIT license make it a lightweight addition. However, be aware that maintenance is aging (last release 362 days ago) and the package has known limitations outside browser notebooks, so verify it works with your specific Jupyter setup before relying on it in production workflows.
Install
ipynbname on PyPI
pip
pip install ipynbnameuv
uv add ipynbnamepoetry
poetry add ipynbnameInstalling ipynbname
Before you install
Low install friction with a single runtime dependency on ipykernel. Maintenance status is aging—last release was 362 days ago and the repository shows minimal recent activity, though it remains unarchived.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install ipynbname
import ipynbname
nb_fname = ipynbname.name()
nb_path = ipynbname.path()
Only works reliably when running in a browser-based Jupyter notebook; does not work with nbconvert or papermill.
Verify before relying
- Whether the package works reliably with current Jupyter versions and modern notebook interfaces.
- Performance characteristics when called repeatedly or in long-running notebooks.
- Compatibility with VS Code workaround mentioned in documentation.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.4) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — ipykernel |
| Maintenance | aging — 362 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 251,605/month — #8,574 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ipynbname-2025.8.0.0-py3-none-any.whl
Keywords: jupyter, notebook, filename
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
nbconvertnbconvert converts Jupyter notebooks (.ipynb…
permissive · top 1,000 on PyPI
notebookJupyter Notebook is a web-based interactive…
permissive · top 1,000 on PyPI
ipynbImports Jupyter Notebook (.ipynb) files as…
permissive · top 15,000 on PyPI
mkdocs-jupyterConverts Jupyter notebooks and Python scripts…
permissive · top 15,000 on PyPI
nbclientnbclient executes Jupyter notebooks…
permissive · top 1,000 on PyPI
nbsphinxnbsphinx is a Sphinx extension that parses…
permissive · top 5,000 on PyPI
testbooktestbook lets you write unit tests for Jupyter…
permissive · top 15,000 on PyPI
importnbimportnb lets you import Jupyter notebooks as…
permissive · top 15,000 on PyPI
pyprojrootFinds your project's root directory and…
permissive · top 15,000 on PyPI
session-info2Captures and displays the versions of all…
copyleft · top 5,000 on PyPI