Provides cache utils
Project description
Classic Cache
Classic Cache - предоставляет функциональность кеширования. Предоставляет утилиты для пометки кеша, бекенд для кеширования в RAM и бекенд для кешироавния в Redis.
Установка
Для установки Classic-Cache вы можете использовать pip:
pip install classic-cache
Для установки Classic-Cache с поддержкой Redis:
pip install classic-cache[redis]
Использование
from classic.cache import cached, InMemoryCache, RedisCache
from classic.components import component
@component
class SomeClass:
# Кэширование результата метода some_method на 60 секунд
@cached(ttl=60)
def some_method(self, arg1: int, arg2: int) -> int:
return arg1 + arg2
# кеширование в памяти
cache = InMemoryCache()
# ИЛИ
# кеширование в Redis
cache = RedisCache(connection=Redis())
some_instance = SomeClass(cache=cache)
# ручная инвалидация кэша
some_instance.some_method.invalidate(1, 2)
# ручное обновление кэша
some_instance.some_method.refresh(1, 2)
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
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 classic_cache-1.2.1.tar.gz.
File metadata
- Download URL: classic_cache-1.2.1.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb98f5cbe4b7f2c2d235ee3006b9aba8f73f1bf51fdc4436ef557510fbcb8cc9
|
|
| MD5 |
4415298cefc44edc2e1a45c307dd9cc7
|
|
| BLAKE2b-256 |
a6b43a4d7994148823c8e4fe324ca4758fcbcfbf4f1a7993c0868c7755022a49
|
Provenance
The following attestation bundles were made for classic_cache-1.2.1.tar.gz:
Publisher:
publish.yml on variasov/classic-cache
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
classic_cache-1.2.1.tar.gz -
Subject digest:
eb98f5cbe4b7f2c2d235ee3006b9aba8f73f1bf51fdc4436ef557510fbcb8cc9 - Sigstore transparency entry: 499783788
- Sigstore integration time:
-
Permalink:
variasov/classic-cache@07a4ce9996daf80b6627cc417f3f76b425b4ed40 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/variasov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@07a4ce9996daf80b6627cc417f3f76b425b4ed40 -
Trigger Event:
push
-
Statement type:
File details
Details for the file classic_cache-1.2.1-py3-none-any.whl.
File metadata
- Download URL: classic_cache-1.2.1-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62e1bdc8666eaa5c8fc9288a63ac6f2b3e1322164a1ca1a6c3ae7a9c1c9b9b7c
|
|
| MD5 |
34aee9282f64e922175f7c4901926170
|
|
| BLAKE2b-256 |
5c3d80af1a09ec55cb63601fa36ffe82aba13af11130a49b2dc5bb848b2c846d
|
Provenance
The following attestation bundles were made for classic_cache-1.2.1-py3-none-any.whl:
Publisher:
publish.yml on variasov/classic-cache
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
classic_cache-1.2.1-py3-none-any.whl -
Subject digest:
62e1bdc8666eaa5c8fc9288a63ac6f2b3e1322164a1ca1a6c3ae7a9c1c9b9b7c - Sigstore transparency entry: 499783836
- Sigstore integration time:
-
Permalink:
variasov/classic-cache@07a4ce9996daf80b6627cc417f3f76b425b4ed40 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/variasov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@07a4ce9996daf80b6627cc417f3f76b425b4ed40 -
Trigger Event:
push
-
Statement type: