Skip to main content

storing cache using dynamodb

Project description

pynamoCacher

Description

A package which allows you to use dynamodb to cache

ToDos

  • Dax support
  • Auto create table
  • policy template
  • example readme

Examples

colabNotebook

SetUp

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'

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


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.2.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

dynamocacher-0.0.2-py3-none-any.whl (2.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page