IoT LRU Cache Library for Python
Project description
iot-lru-cache
This package is an implementation of a Least Recently Used (LRU) caching algorithm for optimized caching on an IoT edge device.
Official Documentation | Source code | Package PyPI
Table of Contents
Versioning
This repository adheres to Semantic Versioning. It will be maintained through the CHANGELOG.md and in GitHub Releases. It's important to note that you must maintain the version with your releases in iot/lru/cache/_version.py, otherwise a new package version will fail to get published.
Getting Started
This section provides basic examples with the iot-lru-cache.
Prerequisites
- Python 3.7 or later is required to use this package.
Basic Examples
- Install via pip:
pip install iot-lru-cache
- Import and say hello:
from iot.lru.cache import __version__
print(f"hello world from iot-lru-cache version: {__version__}")
- Basic usage:
from iot.lru.cache import IoTLRUCache
# instantiate cache
cache = IoTLRUCache(capacity=100)
# print info w/ repr
print(f"{cache.__repr__()}")
# add a key-value pair to the cache
cache.put(key="my_key", value={"my": "value"})
# retrieve the value for a given key (returns -1 if not found)
val = cache.get(key="my_key")
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iot-lru-cache-1.0.0.tar.gz.
File metadata
- Download URL: iot-lru-cache-1.0.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05fbbca28f1445b1ba2d18831e80c0414487f8a892bd56fb25c188c0c22e75fa
|
|
| MD5 |
ab47f5dbb5a5e22e4190fb3193172a1b
|
|
| BLAKE2b-256 |
f70f063f5a9f8dafae3797faa15afa9ff1ebebe0b8541dba5e73335f6f9a23b6
|
File details
Details for the file iot_lru_cache-1.0.0-py3-none-any.whl.
File metadata
- Download URL: iot_lru_cache-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3689d13e30dd8ef31a37f1da6af08ee2f4e96951f0001f835d9ce58c1e09fad
|
|
| MD5 |
8c9189e4b98e9fa3a6659194dd6bbf7f
|
|
| BLAKE2b-256 |
02b7b95df2d8a2ec2295403aa79a05be937dfe271d02f5aab14b4bd95b81b475
|