cache results of slow function to disk
Project description
pyfilecache
import pandas as pd
from functools import partial
from pyfilecache import file_cache
df_cache = partial(file_cache, reader=pd.read_csv, writer=pd.DataFrame.to_csv)
@df_cache
def func(a, b):
print(a, b)
return pd.DataFrame(
data = {
'col1': [1, 2],
'col2': [a, b]
}
)
print(func(3, 4))
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
pyfilecache-0.1.1.tar.gz
(2.3 kB
view details)
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 pyfilecache-0.1.1.tar.gz.
File metadata
- Download URL: pyfilecache-0.1.1.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e86e76b80733166259a22de8f3b7386732dd1eba59b4cbe4e729bd52159a334
|
|
| MD5 |
ffb60b8a370414604df10edaa69a0b16
|
|
| BLAKE2b-256 |
8e9a425c1e97c3444412d98c12394c1a8491d3c399809d80fe89e0736af7a4d1
|
File details
Details for the file pyfilecache-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyfilecache-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7db907365d29ea586ff4918375fad81aee14ae336d1179a2e2d1c42668f25a59
|
|
| MD5 |
ad608d2311504cd13caf751a1e500f0a
|
|
| BLAKE2b-256 |
8254f89d3dbdd8f4d0c25f85473c292223128a94074cef3f40b484974c040035
|