devel/py-klepto: Add py-klepto 0.2.3

klepto extends Python's lru_cache to utilize different keymaps and alternate
caching algorithms, such as lfu_cache and mru_cache. While caching is meant for
fast access to saved results, klepto also has archiving capabilities, for
longer-term storage. klepto uses a simple dictionary-sytle interface for all
caches and archives, and all caches can be applied to any Python function as a
decorator. Keymaps are algorithms for converting a function's input signature to
a unique dictionary, where the function's results are the dictionary value. Thus
for y = f(x), y will be stored in cache[x] (e.g. {x:y}).

klepto provides both standard and "safe" caching, where "safe" caches are slower
but can recover from hashing errors. klepto is intended to be used for
distributed and parallel computing, where several of the keymaps serialize the
stored objects. Caches and archives are intended to be read/write accessible
from different threads and processes. klepto enables a user to decorate a
function, save the results to a file or database archive, close the interpreter,
start a new session, and reload the function and it's cache.
This commit is contained in:
Po-Chuan Hsieh 2023-04-19 01:51:34 +08:00
parent fb73735722
commit 36ae8f643e
No known key found for this signature in database
GPG key ID: 9A4BD10F002DD04B
4 changed files with 44 additions and 0 deletions

View file

@ -4834,6 +4834,7 @@
SUBDIR += py-keystoneauth1
SUBDIR += py-keystonemiddleware
SUBDIR += py-kitchen
SUBDIR += py-klepto
SUBDIR += py-knack
SUBDIR += py-l18n
SUBDIR += py-lark

24
devel/py-klepto/Makefile Normal file
View file

@ -0,0 +1,24 @@
PORTNAME= klepto
PORTVERSION= 0.2.3
CATEGORIES= devel python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Persistent caching to memory, disk, or database
WWW= https://github.com/uqfoundation/klepto
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=42:devel/py-setuptools@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}dill>=0.3.6:devel/py-dill@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pox>=0.3.2:devel/py-pox@${PY_FLAVOR}
USES= python:3.7+
USE_PYTHON= autoplist concurrent pep517
NO_ARCH= yes
.include <bsd.port.mk>

3
devel/py-klepto/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1681836949
SHA256 (klepto-0.2.3.tar.gz) = fc66eca93413d8c348a31de3e7383d37d1f01b9e98755cac8358e9e0a88830c3
SIZE (klepto-0.2.3.tar.gz) = 155892

16
devel/py-klepto/pkg-descr Normal file
View file

@ -0,0 +1,16 @@
klepto extends Python's lru_cache to utilize different keymaps and alternate
caching algorithms, such as lfu_cache and mru_cache. While caching is meant for
fast access to saved results, klepto also has archiving capabilities, for
longer-term storage. klepto uses a simple dictionary-sytle interface for all
caches and archives, and all caches can be applied to any Python function as a
decorator. Keymaps are algorithms for converting a function's input signature to
a unique dictionary, where the function's results are the dictionary value. Thus
for y = f(x), y will be stored in cache[x] (e.g. {x:y}).
klepto provides both standard and "safe" caching, where "safe" caches are slower
but can recover from hashing errors. klepto is intended to be used for
distributed and parallel computing, where several of the keymaps serialize the
stored objects. Caches and archives are intended to be read/write accessible
from different threads and processes. klepto enables a user to decorate a
function, save the results to a file or database archive, close the interpreter,
start a new session, and reload the function and it's cache.