Small Python utility for importing functions, classes, and constants from .ipynb files.
Project description
Small Python utility for importing functions, classes, and constants from .ipynb files. A few other packages offer to provide similar functionality; I wrote this because none of them worked on the first try for me.
Notebooks can be imported from other notebooks or from normal Python scripts. The target notebook is assumed to be located in the current working directory.
You just import the notebook as if it was a submodule of from_notebook. So to import definitions from example.ipynb, any of the following will work:
import from_notebook.example
import from_notebook.example as example
from from_notebook.example import example_function, ExampleClass
No notebook code is executed except for imports, class and def statements, and SNAKE_CAPS = ... assignments. All of these will be executed, so make sure they don't set off any unwanted side effects.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file from-notebook-1.0.0.tar.gz.
File metadata
- Download URL: from-notebook-1.0.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4935b66ccaca09acf17bb327760fa21dcbb3f37466754ced03268c1f59eb09e
|
|
| MD5 |
68dee7c47841a79b0db17fe264e8f4eb
|
|
| BLAKE2b-256 |
15477b1ce56cdd4fa1cfec9adb1e38d6231327203a89c7efbdfa1877abde0576
|
File details
Details for the file from_notebook-1.0.0-py3-none-any.whl.
File metadata
- Download URL: from_notebook-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b4553d143c1c129171967fcb4170e79486457c10fe777489664ce712c4c0b30
|
|
| MD5 |
6f1157978fe271e0f9fb1f93d3e3e885
|
|
| BLAKE2b-256 |
58c0792a0e5eb38ce91475540e7282dc8254ff77e5c7d758cec35cc54b23c36f
|