storing cache using dynamodb
Project description
dynamocacher
Description
A package which allows you to use dynamodb to cache
ToDos
- Dax support
- Auto create table
- policy template
- example readme
Examples
SetUp
from dynamocacher.cacher import Cacher
class Cache(Cacher):
class Meta:
table_name = 'dynamoCache'
region = 'us-east-1'
aws_access_key_id = USER
aws_secret_access_key = PW
billing_mode= 'PAY_PER_REQUEST'
createTable
Cache.create_table()
addCache
sampleInput = {
'query': 'testQuery',
'fruit': 'strawberry'
}
sampleInput2 = {
'query': 'testQuery',
'fruit': 'orange'
}
sampleReturn = {
'pine': 'apple'
}
Cache.addCache(
input = sampleInput,
output = sampleReturn
)
getCache
output = Cache.getCache(sampleInput)
print(output)
{"pine": "apple"}
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
dynamocacher-0.0.6.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for dynamocacher-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 455b68599b101a65f420e884b5d4aaeae5da3b2663b9d6da9ca56167f08bebed |
|
MD5 | a3b2b5fef75d8ba8f761f604659598d1 |
|
BLAKE2b-256 | 1998c6f59a0c3c079085369e9ed0f0e847e245ec79f730e0c2621c6568a1080d |