Skip to content

willcrichton/pickle-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pickle-cache

Small utility for easily and efficiently saving/loading Python values to disk.

Installation

pip install pickle-cache

Usage

from pickle_cache import PickleCache

pc = PickleCache()

pc.set('foo', 'bar')
assert(pc.get('foo') == 'bar')

class Test:
    def __init__(self, x):
        self._x = x

def make_test():
    return Test(1)

assert(pc.get('test', make_test)._x == 1) # compute if not exists
assert(pc.get('test', make_test)._x == 1) # cache if exists

About

Small utility for easily and efficiently saving/loading Python values to disk.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages