Signed URL SDK for Momento
Project description
Momento client-sdk-python-signer
:warning: Experimental SDK :warning:
Python SDK for Momento is experimental and under active development. There could be non-backward compatible changes or removal in the future. Please be aware that you may need to update your source code with the current version of the SDK when its version gets upgraded.
Python SDK for Momento, a serverless cache that automatically scales without any of the operational overhead required by traditional caching solutions.
Getting Started :running:
Requirements
- Python 3.7 or above is required
- A Momento Auth Token is required, you can generate one using the Momento CLI
Installing Momento and Running the Example
Check out our Python SDK example!
Using Momento
import os
from momento import simple_cache_client as scc
# Initializing Momento
_MOMENTO_AUTH_TOKEN = os.getenv('MOMENTO_AUTH_TOKEN')
_ITEM_DEFAULT_TTL_SECONDS = 60
with scc.SimpleCacheClient(_MOMENTO_AUTH_TOKEN, _ITEM_DEFAULT_TTL_SECONDS) as cache_client:
# Creating a cache named "cache"
_CACHE_NAME = 'cache'
cache_client.create_cache(_CACHE_NAME)
# Sets key with default TTL and get value with that key
_KEY = 'MyKey'
_VALUE = 'MyValue'
cache_client.set(_CACHE_NAME, _KEY, _VALUE)
get_resp = cache_client.get(_CACHE_NAME, _KEY)
print(f'Looked up Value: {str(get_resp.value())}')
# Sets key with TTL of 5 seconds
cache_client.set(_CACHE_NAME, _KEY, _VALUE, 5)
# Permanently deletes cache
cache_client.delete_cache(_CACHE_NAME)
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
momento_signer-0.2.2.tar.gz
(9.1 kB
view details)
Built Distribution
File details
Details for the file momento_signer-0.2.2.tar.gz
.
File metadata
- Download URL: momento_signer-0.2.2.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.14 Linux/5.15.0-1070-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd1367201e699a36b4c6b2951a8982c263c204b60a698c8f514696af049a336f |
|
MD5 | 887af144e2b296fbe58494fec8005fd5 |
|
BLAKE2b-256 | 354db03fa58f719c009ce7f5a0109baa35a8590863f982f5e2a33ed502706075 |
File details
Details for the file momento_signer-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: momento_signer-0.2.2-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.14 Linux/5.15.0-1070-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f67003de64358233cadbeb12c5f25775a066483617ae6432d85a4465422c2594 |
|
MD5 | bbea73940cfcf2112045c618ffe0c774 |
|
BLAKE2b-256 | 10c3938549c9749fd1fe43b52431e34deda0ac9ed32bab37d2a8eb3e1da9806d |