Name | iot-lru-cache JSON |
Version |
1.0.0
JSON |
| download |
home_page | |
Summary | IoT LRU Cache Library for Python |
upload_time | 2022-12-14 04:57:59 |
maintainer | |
docs_url | None |
author | Dylan Gonzales |
requires_python | >=3.7 |
license | MIT License |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# iot-lru-cache
[![python version](https://img.shields.io/badge/python_v3.9-blue?logo=python&logoColor=yellow)](https://www.python.org/) [![pre-commit](https://img.shields.io/badge/pre--commit-blue?logo=pre-commit&logoColor=FAB040)](https://pre-commit.com/) [![Keep a Changelog](https://img.shields.io/badge/keep_a_changelog-blue?logo=keepachangelog&logoColor=E05735)](https://keepachangelog.com/en/1.0.0/) [![CI_CD GitHub_Actions](https://img.shields.io/badge/GitHub_Actions-blue?logo=githubactions&logoColor=black)](https://github.com/features/actions) [![package PyPI](https://img.shields.io/badge/PyPI-blue?logo=PyPI&logoColor=yellow)](https://pypi.org/)
This package is an implementation of a Least Recently Used (LRU) caching algorithm for optimized caching on an IoT edge device.
[Official Documentation](https://py-iot-utils.com/packages/iotLruCache) | [Source code](https://github.com/dgonzo27/py-iot-utils/tree/master/iot-lru-cache) | [Package PyPI](https://pypi.org/project/iot-lru-cache/)
## Table of Contents
- [Versioning](#versioning)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Basic Examples](#basic-examples)
## Versioning
This repository adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 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](https://pypi.org/project/pip/):
```sh
pip install iot-lru-cache
```
2. Import and say hello:
```python
from iot.lru.cache import __version__
print(f"hello world from iot-lru-cache version: {__version__}")
```
3. Basic usage:
```python
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")
```
Raw data
{
"_id": null,
"home_page": "",
"name": "iot-lru-cache",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Dylan Gonzales",
"author_email": "py.iot.utils@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f7/0f/063f5a9f8dafae3797faa15afa9ff1ebebe0b8541dba5e73335f6f9a23b6/iot-lru-cache-1.0.0.tar.gz",
"platform": null,
"description": "# iot-lru-cache\n\n[![python version](https://img.shields.io/badge/python_v3.9-blue?logo=python&logoColor=yellow)](https://www.python.org/) [![pre-commit](https://img.shields.io/badge/pre--commit-blue?logo=pre-commit&logoColor=FAB040)](https://pre-commit.com/) [![Keep a Changelog](https://img.shields.io/badge/keep_a_changelog-blue?logo=keepachangelog&logoColor=E05735)](https://keepachangelog.com/en/1.0.0/) [![CI_CD GitHub_Actions](https://img.shields.io/badge/GitHub_Actions-blue?logo=githubactions&logoColor=black)](https://github.com/features/actions) [![package PyPI](https://img.shields.io/badge/PyPI-blue?logo=PyPI&logoColor=yellow)](https://pypi.org/)\n\nThis package is an implementation of a Least Recently Used (LRU) caching algorithm for optimized caching on an IoT edge device.\n\n[Official Documentation](https://py-iot-utils.com/packages/iotLruCache) | [Source code](https://github.com/dgonzo27/py-iot-utils/tree/master/iot-lru-cache) | [Package PyPI](https://pypi.org/project/iot-lru-cache/)\n\n## Table of Contents\n\n- [Versioning](#versioning)\n- [Getting Started](#getting-started)\n - [Prerequisites](#prerequisites)\n - [Basic Examples](#basic-examples)\n\n## Versioning\n\nThis repository adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 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.\n\n## Getting Started\n\nThis section provides basic examples with the `iot-lru-cache`.\n\n### Prerequisites\n\n- Python 3.7 or later is required to use this package.\n\n### Basic Examples\n\n1. Install via [pip](https://pypi.org/project/pip/):\n\n```sh\npip install iot-lru-cache\n```\n\n2. Import and say hello:\n\n```python\nfrom iot.lru.cache import __version__\n\nprint(f\"hello world from iot-lru-cache version: {__version__}\")\n```\n\n3. Basic usage:\n\n```python\nfrom iot.lru.cache import IoTLRUCache\n\n# instantiate cache\ncache = IoTLRUCache(capacity=100)\n\n# print info w/ repr\nprint(f\"{cache.__repr__()}\")\n\n# add a key-value pair to the cache\ncache.put(key=\"my_key\", value={\"my\": \"value\"})\n\n# retrieve the value for a given key (returns -1 if not found)\nval = cache.get(key=\"my_key\")\n```\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "IoT LRU Cache Library for Python",
"version": "1.0.0",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "8c9189e4b98e9fa3a6659194dd6bbf7f",
"sha256": "e3689d13e30dd8ef31a37f1da6af08ee2f4e96951f0001f835d9ce58c1e09fad"
},
"downloads": -1,
"filename": "iot_lru_cache-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8c9189e4b98e9fa3a6659194dd6bbf7f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 3295,
"upload_time": "2022-12-14T04:57:58",
"upload_time_iso_8601": "2022-12-14T04:57:58.241207Z",
"url": "https://files.pythonhosted.org/packages/02/b7/b95df2d8a2ec2295403aa79a05be937dfe271d02f5aab14b4bd95b81b475/iot_lru_cache-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "ab47f5dbb5a5e22e4190fb3193172a1b",
"sha256": "05fbbca28f1445b1ba2d18831e80c0414487f8a892bd56fb25c188c0c22e75fa"
},
"downloads": -1,
"filename": "iot-lru-cache-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "ab47f5dbb5a5e22e4190fb3193172a1b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 3568,
"upload_time": "2022-12-14T04:57:59",
"upload_time_iso_8601": "2022-12-14T04:57:59.824186Z",
"url": "https://files.pythonhosted.org/packages/f7/0f/063f5a9f8dafae3797faa15afa9ff1ebebe0b8541dba5e73335f6f9a23b6/iot-lru-cache-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-14 04:57:59",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "iot-lru-cache"
}