Simply returns either notebook filename or the full path to the notebook when run from Jupyter notebook in browser.
Project description
ipynbname
When run in a Jupyter notebook, simply returns the notebook filename or the full path to the notebook.
I created this to help with automating posting blog posts written in Jupyter notebooks directly to
GitHub Pages.
Check it out if you're looking to use this method of blogging :metal:
You would think there was already some built-in way to access the current notebook name, but it took many hours of searching for a way to do it. As it seems many others did, I tried using Javascript, but the async nature of JS meant that it was unreliable. Finally I stumbled on this post. I have refactored the code there so a user can get either the name or path, but credit for most of the code goes to the author of this post, thanks!
Examples
Get the notebook name:
import ipynbname
nb_fname = ipynbname.name()
Get the full path to the notebook:
import ipynbname
nb_path = ipynbname.path()
Project details
Release history Release notifications | RSS feed
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
Hashes for ipynbname-2021.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66b6d59a4baf376db943433973511a3059a77a5e5395e116cdb2ca63010ddd56 |
|
MD5 | 7b99eeeac29483bf1c897570ff42320d |
|
BLAKE2b-256 | 1d06b1dd03291423949c516a45324c4c612c54a00c7d7fc05586e07cda136b9d |