A simple python package to get the path of the current IPython / Jupyter Notebook file.
Project description
A simple python package to get the path of the current IPython / Jupyter Notebook file.
Installation
pip install ipynb-path
Usage
If you can access to your Jupyter Notebook/Lab server without a password, you can use just ipynb_path.get() in a .ipynb file.
import ipynb_path
__file__ = ipynb_path.get()
If you need a password to access the server, you should specify it.
import ipynb_path
__file__ = ipynb_path.get(password='foo')
You can also specify __name__ for compatibility between .py and .ipynb. In this case, ipynb_path.get() does not overwrite __file__ even if it is called in a .py file.
import ipynb_path
__file__ = ipynb_path.get(__name__)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ipynb-path-0.1.3.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for ipynb_path-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 512c5ce6e685a18be7ee063fa3a328b8563d708e4feb6286646854f1647511a4 |
|
MD5 | fe2a61ebdde0b822028febefddb1f27e |
|
BLAKE2b-256 | 7ba1ed98bf378cd29046ea290007603b4b63c7fe1169f1126fdf72af7cc7dcc4 |