Automatically cache results of intensive computations in IPython.
Project description
%%pdcache cell magic
Automatically cache results of intensive computations in IPython.
Inspired by ipycache.
Installation
$ pip install ipy-pdcache
Usage
In IPython:
In [1]: %load_ext ipy_pdcache
In [2]: import pandas as pd
In [3]: %%pdcache df data.csv
...: df = pd.DataFrame({'A': [1,2,3], 'B': [4,5,6]})
...:
In [4]: !cat data.csv
,A,B
0,1,4
1,2,5
2,3,6
This will cache the dataframe and automatically load it when re-executing the cell.
%load_ext ipy_pdcache import pandas as pd
%%pdcache df data.csv print('hu') df = pd.DataFrame({'A': [1,2,3], 'B': [4,5,6]}) print('ha') 1
Dev:
- https://ipython.readthedocs.io/en/stable/config/extensions/
- https://ipython.readthedocs.io/en/stable/config/custommagics.html#defining-magics
Testing:
- https://medium.com/@davide.sarra/how-to-test-magics-in-ipython-extensions-86d99e5d6802
- https://github.com/davidesarra/jupyter_spaces/blob/master/tests/test_magics.py
Misc:
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
ipy_pdcache-0.0.6.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for ipy_pdcache-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56445a8871b614d67c9729833c6b87d2d4826d9e18b2d748c40de3493fd3309d |
|
MD5 | fef8ca1abcd207178a3790366b6d645b |
|
BLAKE2b-256 | 1e5499c4f08bf0c55715181423e2de8ddbe2326894d95f03af6662eeb3988cc6 |