cachekit 0.1.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cachekit-0.1.0 → cachekit-0.2.1}/Cargo.lock +1 -1
- {cachekit-0.1.0 → cachekit-0.2.1}/PKG-INFO +11 -5
- {cachekit-0.1.0 → cachekit-0.2.1}/README.md +4 -1
- {cachekit-0.1.0 → cachekit-0.2.1}/pyproject.toml +38 -3
- {cachekit-0.1.0 → cachekit-0.2.1}/rust/Cargo.toml +1 -1
- {cachekit-0.1.0 → cachekit-0.2.1}/rust/README.md +4 -1
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/__init__.py +1 -1
- cachekit-0.2.1/src/cachekit/backends/file/__init__.py +30 -0
- cachekit-0.2.1/src/cachekit/backends/file/backend.py +723 -0
- cachekit-0.2.1/src/cachekit/backends/file/config.py +192 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/backends/redis/client.py +51 -11
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/cache_handler.py +30 -27
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/decorators/wrapper.py +24 -2
- {cachekit-0.1.0 → cachekit-0.2.1}/Cargo.toml +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/LICENSE +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/rust/Makefile +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/rust/TEST_EXPANSION_SUMMARY.md +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/rust/src/lib.rs +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/rust/src/python_bindings.rs +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/rust/supply-chain/audits.toml +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/rust/supply-chain/config.toml +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/rust/supply-chain/imports.lock +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/rust/tsan_suppressions.txt +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/backends/__init__.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/backends/base.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/backends/errors.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/backends/provider.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/backends/redis/__init__.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/backends/redis/backend.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/backends/redis/config.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/backends/redis/error_handler.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/backends/redis/provider.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/config/__init__.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/config/decorator.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/config/nested.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/config/settings.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/config/singleton.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/config/validation.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/decorators/__init__.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/decorators/intent.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/decorators/main.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/decorators/orchestrator.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/decorators/session.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/decorators/stats_context.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/decorators/tenant_context.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/decorators/utils/__init__.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/di.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/hash_utils.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/health.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/hiredis_compat.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/imports.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/invalidation/__init__.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/invalidation/channel.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/invalidation/event.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/invalidation/redis_channel.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/key_generator.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/l1_cache.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/logging.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/monitoring/__init__.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/monitoring/correlation_tracking.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/monitoring/pool_monitor.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/monitoring/protocols.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/py.typed +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/reliability/__init__.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/reliability/adaptive_timeout.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/reliability/async_metrics.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/reliability/circuit_breaker.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/reliability/error_classification.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/reliability/load_control.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/reliability/metrics_collection.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/reliability/profiles.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/serializers/__init__.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/serializers/arrow_serializer.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/serializers/auto_serializer.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/serializers/base.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/serializers/encryption_wrapper.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/serializers/orjson_serializer.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/serializers/standard_serializer.py +0 -0
- {cachekit-0.1.0 → cachekit-0.2.1}/src/cachekit/serializers/wrapper.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cachekit
|
|
3
|
-
Version: 0.1
|
|
4
|
-
Classifier: Development Status ::
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
7
7
|
Classifier: Operating System :: OS Independent
|
|
@@ -16,6 +16,8 @@ Classifier: Programming Language :: Rust
|
|
|
16
16
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
17
|
Classifier: Topic :: Database :: Database Engines/Servers
|
|
18
18
|
Classifier: Topic :: System :: Distributed Computing
|
|
19
|
+
Classifier: Topic :: System :: Monitoring
|
|
20
|
+
Classifier: Topic :: Security :: Cryptography
|
|
19
21
|
Classifier: Framework :: AsyncIO
|
|
20
22
|
Classifier: Typing :: Typed
|
|
21
23
|
Requires-Dist: redis[hiredis]>=4.0.0
|
|
@@ -33,8 +35,8 @@ Requires-Dist: pandas>=1.3.0 ; extra == 'data'
|
|
|
33
35
|
Requires-Dist: pyarrow>=21.0.0 ; extra == 'data'
|
|
34
36
|
Provides-Extra: data
|
|
35
37
|
License-File: LICENSE
|
|
36
|
-
Summary: Production-ready Redis caching for Python with intelligent reliability features
|
|
37
|
-
Keywords: redis,cache,caching,decorator,rust,performance,reliability,production
|
|
38
|
+
Summary: Production-ready Redis caching for Python with intelligent reliability features and Rust-powered performance
|
|
39
|
+
Keywords: redis,cache,caching,decorator,rust,performance,reliability,production,encryption,security,circuit-breaker,prometheus,messagepack,distributed-locking
|
|
38
40
|
Home-Page: https://github.com/cachekit-io/cachekit-py
|
|
39
41
|
Author-email: cachekit Contributors <noreply@cachekit.io>
|
|
40
42
|
Maintainer-email: cachekit Contributors <noreply@cachekit.io>
|
|
@@ -45,6 +47,7 @@ Project-URL: Homepage, https://github.com/cachekit-io/cachekit-py
|
|
|
45
47
|
Project-URL: Documentation, https://github.com/cachekit-io/cachekit-py#readme
|
|
46
48
|
Project-URL: Repository, https://github.com/cachekit-io/cachekit-py.git
|
|
47
49
|
Project-URL: Issues, https://github.com/cachekit-io/cachekit-py/issues
|
|
50
|
+
Project-URL: Changelog, https://github.com/cachekit-io/cachekit-py/blob/main/CHANGELOG.md
|
|
48
51
|
|
|
49
52
|
<div align="center">
|
|
50
53
|
|
|
@@ -56,6 +59,7 @@ Production-ready Redis caching for Python with intelligent reliability features
|
|
|
56
59
|
|
|
57
60
|
[![PyPI Version][pypi-badge]][pypi-url]
|
|
58
61
|
[![Python Versions][python-badge]][pypi-url]
|
|
62
|
+
[![codecov][codecov-badge]][codecov-url]
|
|
59
63
|
[![License: MIT][license-badge]][license-url]
|
|
60
64
|
|
|
61
65
|
</div>
|
|
@@ -216,7 +220,7 @@ def test_cached_function():
|
|
|
216
220
|
- Circuit breaker with graceful degradation
|
|
217
221
|
- Connection pooling with thread affinity (+28% throughput)
|
|
218
222
|
- Distributed locking prevents cache stampedes
|
|
219
|
-
- Pluggable backend abstraction (Redis, HTTP, DynamoDB, custom)
|
|
223
|
+
- Pluggable backend abstraction (Redis, File, HTTP, DynamoDB, custom)
|
|
220
224
|
|
|
221
225
|
> [!NOTE]
|
|
222
226
|
> All reliability features are **enabled by default** with `@cache.production`. Use `@cache.minimal` to disable them for maximum throughput.
|
|
@@ -430,4 +434,6 @@ MIT License - see [LICENSE][license-file-url] for details.
|
|
|
430
434
|
[license-file-url]: LICENSE
|
|
431
435
|
[github-url]: https://github.com/cachekit-io/cachekit-py
|
|
432
436
|
[issues-url]: https://github.com/cachekit-io/cachekit-py/issues
|
|
437
|
+
[codecov-badge]: https://codecov.io/github/cachekit-io/cachekit-py/graph/badge.svg
|
|
438
|
+
[codecov-url]: https://codecov.io/github/cachekit-io/cachekit-py
|
|
433
439
|
|
|
@@ -8,6 +8,7 @@ Production-ready Redis caching for Python with intelligent reliability features
|
|
|
8
8
|
|
|
9
9
|
[![PyPI Version][pypi-badge]][pypi-url]
|
|
10
10
|
[![Python Versions][python-badge]][pypi-url]
|
|
11
|
+
[![codecov][codecov-badge]][codecov-url]
|
|
11
12
|
[![License: MIT][license-badge]][license-url]
|
|
12
13
|
|
|
13
14
|
</div>
|
|
@@ -168,7 +169,7 @@ def test_cached_function():
|
|
|
168
169
|
- Circuit breaker with graceful degradation
|
|
169
170
|
- Connection pooling with thread affinity (+28% throughput)
|
|
170
171
|
- Distributed locking prevents cache stampedes
|
|
171
|
-
- Pluggable backend abstraction (Redis, HTTP, DynamoDB, custom)
|
|
172
|
+
- Pluggable backend abstraction (Redis, File, HTTP, DynamoDB, custom)
|
|
172
173
|
|
|
173
174
|
> [!NOTE]
|
|
174
175
|
> All reliability features are **enabled by default** with `@cache.production`. Use `@cache.minimal` to disable them for maximum throughput.
|
|
@@ -382,3 +383,5 @@ MIT License - see [LICENSE][license-file-url] for details.
|
|
|
382
383
|
[license-file-url]: LICENSE
|
|
383
384
|
[github-url]: https://github.com/cachekit-io/cachekit-py
|
|
384
385
|
[issues-url]: https://github.com/cachekit-io/cachekit-py/issues
|
|
386
|
+
[codecov-badge]: https://codecov.io/github/cachekit-io/cachekit-py/graph/badge.svg
|
|
387
|
+
[codecov-url]: https://codecov.io/github/cachekit-io/cachekit-py
|
|
@@ -4,8 +4,8 @@ build-backend = "maturin"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cachekit"
|
|
7
|
-
version = "0.1
|
|
8
|
-
description = "Production-ready Redis caching for Python with intelligent reliability features"
|
|
7
|
+
version = "0.2.1"
|
|
8
|
+
description = "Production-ready Redis caching for Python with intelligent reliability features and Rust-powered performance"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
11
11
|
authors = [
|
|
@@ -23,9 +23,15 @@ keywords = [
|
|
|
23
23
|
"performance",
|
|
24
24
|
"reliability",
|
|
25
25
|
"production",
|
|
26
|
+
"encryption",
|
|
27
|
+
"security",
|
|
28
|
+
"circuit-breaker",
|
|
29
|
+
"prometheus",
|
|
30
|
+
"messagepack",
|
|
31
|
+
"distributed-locking",
|
|
26
32
|
]
|
|
27
33
|
classifiers = [
|
|
28
|
-
"Development Status ::
|
|
34
|
+
"Development Status :: 3 - Alpha",
|
|
29
35
|
"Intended Audience :: Developers",
|
|
30
36
|
"License :: OSI Approved :: MIT License",
|
|
31
37
|
"Operating System :: OS Independent",
|
|
@@ -40,6 +46,8 @@ classifiers = [
|
|
|
40
46
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
41
47
|
"Topic :: Database :: Database Engines/Servers",
|
|
42
48
|
"Topic :: System :: Distributed Computing",
|
|
49
|
+
"Topic :: System :: Monitoring",
|
|
50
|
+
"Topic :: Security :: Cryptography",
|
|
43
51
|
"Framework :: AsyncIO",
|
|
44
52
|
"Typing :: Typed",
|
|
45
53
|
]
|
|
@@ -75,6 +83,7 @@ Homepage = "https://github.com/cachekit-io/cachekit-py"
|
|
|
75
83
|
Documentation = "https://github.com/cachekit-io/cachekit-py#readme"
|
|
76
84
|
Repository = "https://github.com/cachekit-io/cachekit-py.git"
|
|
77
85
|
Issues = "https://github.com/cachekit-io/cachekit-py/issues"
|
|
86
|
+
Changelog = "https://github.com/cachekit-io/cachekit-py/blob/main/CHANGELOG.md"
|
|
78
87
|
|
|
79
88
|
# Maturin configuration for Rust extensions
|
|
80
89
|
[tool.maturin]
|
|
@@ -158,6 +167,32 @@ doctest_optionflags = [
|
|
|
158
167
|
"ELLIPSIS",
|
|
159
168
|
]
|
|
160
169
|
|
|
170
|
+
# Coverage configuration
|
|
171
|
+
[tool.coverage.run]
|
|
172
|
+
source = ["src/cachekit"]
|
|
173
|
+
branch = true
|
|
174
|
+
omit = [
|
|
175
|
+
"*/tests/*",
|
|
176
|
+
"*/__pycache__/*",
|
|
177
|
+
"*/.venv/*",
|
|
178
|
+
]
|
|
179
|
+
|
|
180
|
+
[tool.coverage.report]
|
|
181
|
+
precision = 2
|
|
182
|
+
show_missing = true
|
|
183
|
+
skip_covered = false
|
|
184
|
+
exclude_lines = [
|
|
185
|
+
"pragma: no cover",
|
|
186
|
+
"def __repr__",
|
|
187
|
+
"raise AssertionError",
|
|
188
|
+
"raise NotImplementedError",
|
|
189
|
+
"if __name__ == .__main__.:",
|
|
190
|
+
"if TYPE_CHECKING:",
|
|
191
|
+
"@abstractmethod",
|
|
192
|
+
"@overload",
|
|
193
|
+
"class .*\\bProtocol\\b.*:",
|
|
194
|
+
]
|
|
195
|
+
|
|
161
196
|
[dependency-groups]
|
|
162
197
|
dev = [
|
|
163
198
|
# Testing
|
|
@@ -8,6 +8,7 @@ Production-ready Redis caching for Python with intelligent reliability features
|
|
|
8
8
|
|
|
9
9
|
[![PyPI Version][pypi-badge]][pypi-url]
|
|
10
10
|
[![Python Versions][python-badge]][pypi-url]
|
|
11
|
+
[![codecov][codecov-badge]][codecov-url]
|
|
11
12
|
[![License: MIT][license-badge]][license-url]
|
|
12
13
|
|
|
13
14
|
</div>
|
|
@@ -168,7 +169,7 @@ def test_cached_function():
|
|
|
168
169
|
- Circuit breaker with graceful degradation
|
|
169
170
|
- Connection pooling with thread affinity (+28% throughput)
|
|
170
171
|
- Distributed locking prevents cache stampedes
|
|
171
|
-
- Pluggable backend abstraction (Redis, HTTP, DynamoDB, custom)
|
|
172
|
+
- Pluggable backend abstraction (Redis, File, HTTP, DynamoDB, custom)
|
|
172
173
|
|
|
173
174
|
> [!NOTE]
|
|
174
175
|
> All reliability features are **enabled by default** with `@cache.production`. Use `@cache.minimal` to disable them for maximum throughput.
|
|
@@ -382,3 +383,5 @@ MIT License - see [LICENSE][license-file-url] for details.
|
|
|
382
383
|
[license-file-url]: LICENSE
|
|
383
384
|
[github-url]: https://github.com/cachekit-io/cachekit-py
|
|
384
385
|
[issues-url]: https://github.com/cachekit-io/cachekit-py/issues
|
|
386
|
+
[codecov-badge]: https://codecov.io/github/cachekit-io/cachekit-py/graph/badge.svg
|
|
387
|
+
[codecov-url]: https://codecov.io/github/cachekit-io/cachekit-py
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""File-based backend for local disk caching.
|
|
2
|
+
|
|
3
|
+
This module provides a production-ready filesystem-based cache backend with:
|
|
4
|
+
- Thread-safe operations using reentrant locks and file-level locking
|
|
5
|
+
- Atomic writes via write-then-rename pattern
|
|
6
|
+
- LRU eviction based on disk usage thresholds
|
|
7
|
+
- TTL-based expiration with secure header format
|
|
8
|
+
- Security features (O_NOFOLLOW, symlink prevention)
|
|
9
|
+
|
|
10
|
+
Public API:
|
|
11
|
+
- FileBackend: Main backend implementation
|
|
12
|
+
- FileBackendConfig: Configuration class
|
|
13
|
+
|
|
14
|
+
Example:
|
|
15
|
+
>>> from cachekit.backends.file import FileBackend, FileBackendConfig
|
|
16
|
+
>>> config = FileBackendConfig(cache_dir="/tmp/cachekit")
|
|
17
|
+
>>> backend = FileBackend(config)
|
|
18
|
+
>>> backend.set("key", b"value", ttl=60)
|
|
19
|
+
>>> data = backend.get("key")
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
from cachekit.backends.file.backend import FileBackend
|
|
25
|
+
from cachekit.backends.file.config import FileBackendConfig
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"FileBackend",
|
|
29
|
+
"FileBackendConfig",
|
|
30
|
+
]
|