Skip to main content

IoT LRU Cache Library for Python

Project description

iot-lru-cache

python version pre-commit Keep a Changelog CI_CD GitHub_Actions package PyPI

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

  1. Install via pip:
pip install iot-lru-cache
  1. Import and say hello:
from iot.lru.cache import __version__

print(f"hello world from iot-lru-cache version: {__version__}")
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iot-lru-cache-1.0.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iot_lru_cache-1.0.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

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

Hashes for iot-lru-cache-1.0.0.tar.gz
Algorithm Hash digest
SHA256 05fbbca28f1445b1ba2d18831e80c0414487f8a892bd56fb25c188c0c22e75fa
MD5 ab47f5dbb5a5e22e4190fb3193172a1b
BLAKE2b-256 f70f063f5a9f8dafae3797faa15afa9ff1ebebe0b8541dba5e73335f6f9a23b6

See more details on using hashes here.

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

Hashes for iot_lru_cache-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3689d13e30dd8ef31a37f1da6af08ee2f4e96951f0001f835d9ce58c1e09fad
MD5 8c9189e4b98e9fa3a6659194dd6bbf7f
BLAKE2b-256 02b7b95df2d8a2ec2295403aa79a05be937dfe271d02f5aab14b4bd95b81b475

See more details on using hashes here.

Supported by

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