The `ipynbname` library (current version 2025.8.0.0) provides a simple utility to retrieve the filename or full path of the current Jupyter notebook when executed within a browser-based Jupyter environment or VS Code. It was created to address the lack of a built-in, reliable method for accessing this information, especially for tasks like automating blog post publishing from notebooks. The project is actively maintained with a release cadence of typically once or twice a year.
pip install ipynbnameVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to retrieve the current Jupyter notebook's filename and full path using `ipynbname.name()` and `ipynbname.path()`. It includes basic error handling for common scenarios.
Avoid using `ipynbname` in non-interactive or programmatic notebook execution workflows. If a notebook's name or path is needed in such contexts, consider passing it as an argument or using environment-specific methods.
If encountering issues in a password-protected Jupyter environment, consult the `ipynbname` GitHub repository for potential workarounds or reported issues. Temporarily disabling the password (for testing purposes) might help diagnose the problem.
If experiencing inconsistent results in VS Code, refer to the official `ipynbname` GitHub README or PyPI page for the latest recommendations and troubleshooting steps specific to VS Code integration.
Ensure the notebook is being run in a standard browser-based Jupyter environment or a explicitly supported VS Code setup. If using JupyterHub, verify its configuration or check for known compatibility issues on the `ipynbname` GitHub page. Avoid running `ipynbname` in headless or programmatic execution pipelines.
Restarting the Jupyter kernel or the entire Jupyter server can often resolve transient `IndexError` issues. Ensure the notebook is saved and that the Jupyter environment is stable. If the problem persists, check for environment-specific bugs on the `ipynbname` GitHub repository.
No dependency data recorded yet.