Skip to main content

Defines a %%cache cell magic in the IPython notebook to cache results of long-lasting computations in a persistentpickle file.

Project description

Defines a %%cache cell magic in the IPython notebook to cache results of long-lasting computations in a persistent pickle file. Useful when some computations in a notebook are long and you want to easily save the results in a file.

Example

Installation

  • pip install ipycache

Usage

  • In IPython:

    %load_ext ipycache

  • Then, create a cell with:

    %%cache var1 var2 –to=mycache.pkl var1 = 1 var2 = 2

  • When you execute this cell the first time, the code is executed, and the variables var1 and var2 are saved in mycache.pkl in the current directory. When you execute this cell again, the code is skipped and the variables are loaded from the file. Use the –force or -f option to force the cell’s execution and overwrite the file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipycache-0.1.0.zip (5.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page