Easily stash the results of expensive functions to disk
Project description
🐿️ Scrat
Easily stash the results of expensive functions to disk.
Get Started
- Install with
pip install git+https://github.com/javiber/scrat.git
(pypi package coming soon) - Initialize stash
scrat init
- Start saving time:
import scrat as sc
import time
@sc.stash()
def expensive_function(param_1):
time.sleep(3)
return param_1
expensive_function(1) # <- function called
expensive_function(1) # <- function not called the result is recovered from stash
expensive_function(2) # <- function called again beacuse the parameters changed
Features
- Stores results to disk so they can be reused in different runs
- Automatically re-runs the function if the parameters or the function code changed
- Automatically saves any result using pickle
- Automatically saves pandas DataFrames as parquet
- Customizable to allow other serializers to store any kind of result efficiently
- Customizable to hash any type of parameter efficiently
- CLI to control stash
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
scrat-0.1.0.tar.gz
(11.1 kB
view details)
Built Distribution
scrat-0.1.0-py3-none-any.whl
(15.9 kB
view details)
File details
Details for the file scrat-0.1.0.tar.gz
.
File metadata
- Download URL: scrat-0.1.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a4351acb51f7a42c5562d9de4366d387ae1816bc7df1fe28f3a2a56f0c4391f |
|
MD5 | 49d90d1c60061c67677a2c46853901b0 |
|
BLAKE2b-256 | 5f6da550055fb806e7d7f0010fa41f43a8571bbe5f5ffd0dfcd83d9f572102a3 |
Provenance
File details
Details for the file scrat-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: scrat-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af41aa229698f50fc8de7989e14de1d6e6657463609874423c0e66dbd6bdd962 |
|
MD5 | 26621c14473efaa27bc6391c8c0d5399 |
|
BLAKE2b-256 | 071994fa47967f31f3d6ee62d7fdba7f53ab81c45f5d4945ca631cbfdb29369b |