Momento client-sdk-python
⚠️ Experimental SDK ⚠️
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 🏃
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)
Metadata
Release files for momento 0.16.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| momento-0.16.3.tar.gz | 28.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| momento-0.16.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 66.4 kB
Release files / momento-0.16.3.tar.gz
| Download URL | momento-0.16.3.tar.gz |
|---|---|
| Size | 28.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a9d30e1cc06d51625a99d7616ee229c9eb9524e5ec05618a59815274fe97659
|
|
BLAKE2b-256 checksum How to use checksums |
c448d0cf83bf7a11b3f7c58202049121288bc95062ce075e504d454891f63820
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.10.8 Linux/5.15.0-1022-azure
|
Release files / momento-0.16.3-py3-none-any.whl
| Download URL | momento-0.16.3-py3-none-any.whl |
|---|---|
| Size | 37.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
11eb657fcb2fc3bdf1db7b2ef01317f718bae273a0c0fd4911edf4f28820fbeb
|
|
BLAKE2b-256 checksum How to use checksums |
380db545e7d59f7c0abd69a788c279c9dd838040dbe494cf3daac6c767ccf0bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.10.8 Linux/5.15.0-1022-azure
|
Security for momento 0.16.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.