Skip to main content

PyPI Version Test Coverage Read the Docs Status View on GitHub Python Version

Overview

LiveImport reliably and automatically reloads Python modules in Jupyter notebooks. Unlike IPython's autoreload extension, LiveImport reloads are well-defined, deterministic operations that follow the semantics of a developer's import statements exactly. It maintains consistency between modules by automatically reloading dependent modules as needed, ensuring up-to-date references across a notebook and its modules.

LiveImport is designed for developers who interactively build Jupyter notebooks together with external Python code, and who want predictable reloading with minimal mystery.

Given a cell like

%%liveimport
from common import *
from nets import ConvNet, ResidualNet as ResNet
import hyperparam as hp

LiveImport will execute the import statements, then automatically reload common, nets, or hyperparam whenever their source files change. When LiveImport reloads, it will rebind names in the notebook as described by the import statements. If nets imports from hyperparam, then when hyperparam is modified, LiveImport will automatically reload nets after hyperparam.

To make the cell above transparent to IDEs like Visual Studio Code, you can hide the cell magic:

#_%%liveimport
from common import *
from nets import ConvNet, ResidualNet as ResNet
import hyperparam as hp

Hidden cell magic is a user experience feature tailored for modern notebook development. Others include tracking indirectly imported modules, protection against reloading in the middle of multi-cell runs, and optional reload notification.

If you currently use autoreload, you might consider comparing LiveImport to autoreload.

Documentation

See liveimport.readthedocs.io for a user guide and an API reference.

Installation

You can install LiveImport from PyPI with

$ pip install liveimport

LiveImport is normally enabled by importing it into a notebook. But you can also enable it by default using a profile or installing the autoload extra.

$ pip install "liveimport[autoload]"

LiveImport requires Python 3.10 or greater and IPython 7.23.1 or greater.

Reliability

LiveImport includes automated tests with 100% code coverage, which are run on MacOS, Linux, and Windows with Python versions 3.10 through 3.15 using both the oldest supported and latest versions of IPython. Notebook integration features are tested using notebook 5.7.0 and notebook latest. See the GitHub workflow for details.

If you have a copy of the source, you can run the tests yourself with

$ python test/main.py

Questions or Issues

If you have any questions or encounter any issues, please submit them on GitHub.

Metadata

Release files for liveimport 1.3.1

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

Source distribution (sdist)

Source distribution for liveimport 1.3.1
File Size Uploaded
liveimport-1.3.1.tar.gz 20.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for liveimport 1.3.1
File Interpreter ABI Platform
liveimport-1.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 41.0 kB

Release files / liveimport-1.3.1.tar.gz

Download URL liveimport-1.3.1.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ce3e24bc87d9d9a421fc522d1f2887b02b4fe7d70355dee228a51f918bbf7675
BLAKE2b-256 checksum
How to use checksums
962c88eddf8683472d859a4c2199e53a9b08fdc827d521fa8fbe8fd209b010ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / liveimport-1.3.1-py3-none-any.whl

Download URL liveimport-1.3.1-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4424c49e421c68202fa85798bea555820d64a849a0d1261b9e9ed4facfbef739
BLAKE2b-256 checksum
How to use checksums
9d04bcea735fd40d55117ed6697c80788b0cb670e6698b768b2d7c0caeee3434
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

1.3.1 This release

2 release files

1.3.0

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

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