Skip to main content

Jupyter Inheritance

Inherit Jupyter Kernels

You have a notebook base.ipynb with a cell

import os
from datetime import datetime

class Test:
    msg = "Hey!"

def add(x, y):
    return x + y
    
test = Test()
now = datetime.now()

that has been executed. You can create a new notebook and run the following code:

from jupyter_inheritance import inherit_from
inherit_from("base.ipynb")

assert add(1, 4) == 5
assert isinstance(test, Test)

print(test.msg)
print(now)  # same value as `now` in `base.ipynb`!
print(os.listdir("."))

The base.ipynb content is not executed from scratch in the new notebook, all the existing objects are copied directly from base.ipynb kernel. This ensures that everything stays exactly the same (e.g. timestamps, random numbers, responses from externals APIs).

You can even do mixins!

from jupyter_inheritance import inherit_from
for notebook in ("base_1.ipynb", "base_2.ipynb"):
    inherit_from(notebook)

Installation

Just the usual

pip install jupyter-inheritance

Metadata

Release files for jupyter-inheritance 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyter-inheritance 0.1.0
File Size Uploaded Provenance
jupyter-inheritance-0.1.0.tar.gz 3.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for jupyter-inheritance 0.1.0
File Interpreter ABI Platform
jupyter_inheritance-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.9 kB

Release files / jupyter-inheritance-0.1.0.tar.gz

Download URL jupyter-inheritance-0.1.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
51ed0462c7482a3374f965c3835a7254afca447f789a1777bc33729c0d538962
BLAKE2b-256 checksum
How to use checksums
66b1ab4988ac1dd0da9fde06a311f0d0e5f5c0ad8ef3ee6c8ce8317bf6aa4510
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

Release files / jupyter_inheritance-0.1.0-py3-none-any.whl

Download URL jupyter_inheritance-0.1.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4ac7d81cb6eb99ca145901c6ef1e46a975e68224b8bda98b705abc15ff62a41
BLAKE2b-256 checksum
How to use checksums
c2fbaebda62f6f3233fb0016d50ac1e836689457a48b00fa8cc904a34fa21180
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

Security for jupyter-inheritance 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page