Warm up Python environments by importing packages and triggering side effects (font caches, C extensions, BLAS discovery).
Project description
prewarm
Warm up Python environments by importing packages and triggering their one-time side effects — font caches, C extension loading, BLAS discovery, and more.
Usage
# Warm up via IPython (warms IPython's own init + packages)
prewarm matplotlib pandas numpy
# Or as a module
python -m prewarm matplotlib pandas numpy
# Skip IPython, just import directly
prewarm --no-ipython matplotlib pandas
API
from prewarm import warm
# Boot IPython, import modules, exit
warm(["matplotlib", "pandas"])
# Just import, no IPython
warm(["matplotlib", "pandas"], ipython=False)
Why?
First imports of heavy packages like matplotlib and pandas are slow — they
build font caches, load C extensions, discover BLAS libraries, etc.
Running prewarm in a fresh environment triggers all of these one-time
costs up front so subsequent imports are fast.
When run with IPython (the default), it also warms IPython's startup path: traitlets configuration, magic commands, tab completion, and the display system. This is especially useful for Jupyter kernels where IPython boot time is part of the perceived startup latency.
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 prewarm-0.0.1.tar.gz.
File metadata
- Download URL: prewarm-0.0.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e1356dea48cfa9dd69ee82da00ce6ac07b156c6af3db8ea2f5a9cf1749a271b
|
|
| MD5 |
8cbe3d49c2857060e3e7330e3ec43923
|
|
| BLAKE2b-256 |
00eb0bdc8f502d6eb1d60ebe7f45711a814baca5362b6fef6bf08e0715b2d6f0
|
File details
Details for the file prewarm-0.0.1-py3-none-any.whl.
File metadata
- Download URL: prewarm-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1aeeca194beb5ae33356b6d255da27249b3572c7bd80f728441c33b848c9b3dd
|
|
| MD5 |
8157d8c8c2e2a07e65c7f59cbf5f783e
|
|
| BLAKE2b-256 |
0ed9f6b5dcaf048507beae6bf80f4c47ef914dcd30f221ab8ecd660b40626370
|