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.

LiveImport is normally enabled by importing it into a notebook. But you can also enable it by default.

Documentation

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

Installation

You can install LiveImport from PyPI with

$ pip install liveimport

You can also clone the repository and install it directly.

$ git clone https://github.com/escreven/liveimport.git
$ cd liveimport
$ pip install .

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 3.10, 3.11, 3.12, 3.13, and 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.6

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.6
File Size Uploaded
liveimport-1.2.6.tar.gz 19.0 kB Details

Built distribution (wheel)

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

Total release size: 37.8 kB

Release files / liveimport-1.2.6.tar.gz

Download URL liveimport-1.2.6.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
98792ac5ae59ae4a490b958d2ad8342ba69f9e56885bc811829f79fb2dedec05
BLAKE2b-256 checksum
How to use checksums
b415be60005995b98067e8d1360ff440236c01ebd2b55661b759ea3393e7751f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

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

Download URL liveimport-1.2.6-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef5e9df262021f9f1b23e7ced29f84376f0c38d798e219fed8f304763f7a6af2
BLAKE2b-256 checksum
How to use checksums
fce2d10aa5157e61a451fd42fd12619e99c4c02d4d0aea8abae30f8bfb2e6c9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release history Release notifications | RSS feed

1.3.1

2 release files

1.3.0

2 release files

1.2.7

2 release files

This release

1.2.6 This release

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