A python package that allows importing Jupyter notebooks as python modules
Project description
Jupyter notebooks module loader
Allows to import Jupyter notebooks as if there were regular python modules.
The code is based on the following example from Jupyter's documentation:
https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Importing%20Notebooks.html
Installation
pip install jupyter-module-loader
Usage
Suppose a project has the following files structure:
src/
├── main.py
└── my_notebook.ipynb
Let my_notebook.ipynb
have a cell containing following code:
def fn():
...
Within main.py
it is possible to import my_notebook.ipynb
like so:
import jupyter_module_loader
jupyter_module_loader.register()
import my_notebook
my_notebook.fn() # Calls fn() defined within the notebook above
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
File details
Details for the file jupyter-module-loader-0.0.1.tar.gz
.
File metadata
- Download URL: jupyter-module-loader-0.0.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad939e21c5019607f06d6c9217d5692f35bbbd5c2028b84761166dc8d87542de |
|
MD5 | 59bc9ab4147d248dc835b4744d6b9808 |
|
BLAKE2b-256 | 8cb8d37e26e923080ea07e5bf3b83b83a4dc0a76f74596ba047282a419127bc4 |
File details
Details for the file jupyter_module_loader-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: jupyter_module_loader-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fb12601d4cc0454f4b68d768e6e557b7792cbe802afb42f0a3930ec109ddd08 |
|
MD5 | 31794e8cc3068f7a74f2705ddf1d0eb6 |
|
BLAKE2b-256 | acbc9545240c8914bdd8891aadc880dd118d0f6657745ce313afaba9e66080b9 |