==========================
Behold, the power of Memosa:
from memosa import memoize1
from memosa.json import context
import requests
@memoize1
def getTodo(id):
url = 'https://jsonplaceholder.typicode.com/todos/%s' % id
return requests.get(url).json()
with context('todos.json'):
print(getTodo(1))
print(getTodo(2))
- memoization decorators
- persistent cache context
Memosa officially supports Python 3.6 & 3.7.
To install Memosa, simply use pip:
$ pip install memosa
check out the examples