Skip to main content

PyPI Version Test Coverage Read the Docs Status View on GitHub

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.14 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.2.7

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.2.7
File Size Uploaded
liveimport-1.2.7.tar.gz 19.7 kB Details

Built distribution (wheel)

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

Total release size: 39.7 kB

Release files / liveimport-1.2.7.tar.gz

Download URL liveimport-1.2.7.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
98b2d911e00dc7adc2777738eb9b1d7c9c0e90d4540d8a7db30d4f626aed0c06
BLAKE2b-256 checksum
How to use checksums
0e495aa0c550a567969595da73dc1c08c018f48b8f096b3de209d11d703c8350
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.2.7-py3-none-any.whl

Download URL liveimport-1.2.7-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79adb9283138d5f2348b4a4fec1927d7d86083fbba163a982595abe1e74902e2
BLAKE2b-256 checksum
How to use checksums
03db98bb045b0b41b902b78c359eaf81a7348442de592204aee5e100995ea4ac
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

1.3.1

2 release files

1.3.0

2 release files

This release

1.2.7 This release

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