skillfed

ipynbname

Simply returns either notebook filename or the full path to the notebook when run from Jupyter notebook in browser.

ipynbname v2025.8.0.0 251.6K downloads/30d#8,574 on PyPI65
Permissive license MIT AGING released

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 ipynbname

uv

uv add ipynbname

poetry

poetry add ipynbname

Installing 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

Development Status :: 4 - BetaFramework :: JupyterLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentTopic :: Utilities

Tags

get jupyter notebook filenamecurrent notebook pathnotebook name in jupyteraccess notebook filename programmaticallyjupyter notebook metadatanotebook file path detectionjupyter environment introspection
jupyter-integrationnotebook-automation

More Utilities packages