diskcache-rs 0.4.12__cp315-cp315-win_amd64.whl
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.
- diskcache_rs/__init__.py +91 -0
- diskcache_rs/__init__.pyi +756 -0
- diskcache_rs/_diskcache_rs.cp315-win_amd64.pyd +0 -0
- diskcache_rs/_diskcache_rs.pyi +157 -0
- diskcache_rs/cache.py +2830 -0
- diskcache_rs/constants.py +125 -0
- diskcache_rs/core.py +41 -0
- diskcache_rs/disk.py +252 -0
- diskcache_rs/djangocache.py +118 -0
- diskcache_rs/fast_cache.py +386 -0
- diskcache_rs/pickle_cache.py +257 -0
- diskcache_rs/recipes.py +535 -0
- diskcache_rs/rust_pickle.py +77 -0
- diskcache_rs-0.4.12.dist-info/METADATA +669 -0
- diskcache_rs-0.4.12.dist-info/RECORD +18 -0
- diskcache_rs-0.4.12.dist-info/WHEEL +4 -0
- diskcache_rs-0.4.12.dist-info/licenses/LICENSE +195 -0
- diskcache_rs-0.4.12.dist-info/sboms/diskcache_rs.cyclonedx.json +3780 -0
diskcache_rs/__init__.py
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"""
|
|
2
|
+
DiskCache RS - A high-performance disk cache implementation in Rust with Python bindings
|
|
3
|
+
|
|
4
|
+
This module provides a Python interface compatible with python-diskcache,
|
|
5
|
+
but implemented in Rust for better performance and network filesystem support.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
# Always use the Python wrapper for now
|
|
9
|
+
# The Python wrapper will handle importing the Rust implementation
|
|
10
|
+
from .cache import Cache, Deque, FanoutCache, Index
|
|
11
|
+
from .fast_cache import FastCache, FastFanoutCache
|
|
12
|
+
from .pickle_cache import PickleCache, cache_object, clear_cache, get_cached_object
|
|
13
|
+
|
|
14
|
+
# Constants, exceptions, and warnings (compatible with diskcache.core)
|
|
15
|
+
from .constants import (
|
|
16
|
+
DEFAULT_SETTINGS,
|
|
17
|
+
ENOVAL,
|
|
18
|
+
EVICTION_POLICY,
|
|
19
|
+
UNKNOWN,
|
|
20
|
+
EmptyDirWarning,
|
|
21
|
+
Timeout,
|
|
22
|
+
UnknownFileWarning,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
# Disk serialization classes (compatible with diskcache.core)
|
|
26
|
+
from .disk import Disk, JSONDisk
|
|
27
|
+
|
|
28
|
+
# Recipes: synchronization primitives, rate limiting, cache stampede protection
|
|
29
|
+
from .recipes import (
|
|
30
|
+
Averager,
|
|
31
|
+
BoundedSemaphore,
|
|
32
|
+
Lock,
|
|
33
|
+
RLock,
|
|
34
|
+
barrier,
|
|
35
|
+
memoize_stampede,
|
|
36
|
+
throttle,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
# Import Rust pickle functions
|
|
40
|
+
try:
|
|
41
|
+
from ._diskcache_rs import rust_pickle_dumps, rust_pickle_loads
|
|
42
|
+
except ImportError:
|
|
43
|
+
rust_pickle_dumps = None
|
|
44
|
+
rust_pickle_loads = None
|
|
45
|
+
|
|
46
|
+
# Version is exported from Rust core module
|
|
47
|
+
from ._diskcache_rs import __version__
|
|
48
|
+
|
|
49
|
+
from .djangocache import DjangoCache
|
|
50
|
+
|
|
51
|
+
__all__ = [
|
|
52
|
+
# Core cache classes
|
|
53
|
+
"Cache",
|
|
54
|
+
"FanoutCache",
|
|
55
|
+
"Deque",
|
|
56
|
+
"Index",
|
|
57
|
+
# Constants
|
|
58
|
+
"DEFAULT_SETTINGS",
|
|
59
|
+
"ENOVAL",
|
|
60
|
+
"EVICTION_POLICY",
|
|
61
|
+
"UNKNOWN",
|
|
62
|
+
# Disk serialization
|
|
63
|
+
"Disk",
|
|
64
|
+
"JSONDisk",
|
|
65
|
+
# Exceptions and warnings
|
|
66
|
+
"Timeout",
|
|
67
|
+
"EmptyDirWarning",
|
|
68
|
+
"UnknownFileWarning",
|
|
69
|
+
# Recipes: synchronization primitives
|
|
70
|
+
"Lock",
|
|
71
|
+
"RLock",
|
|
72
|
+
"BoundedSemaphore",
|
|
73
|
+
# Recipes: decorators
|
|
74
|
+
"Averager",
|
|
75
|
+
"barrier",
|
|
76
|
+
"memoize_stampede",
|
|
77
|
+
"throttle",
|
|
78
|
+
# diskcache_rs extras
|
|
79
|
+
"PickleCache",
|
|
80
|
+
"cache_object",
|
|
81
|
+
"get_cached_object",
|
|
82
|
+
"clear_cache",
|
|
83
|
+
"FastCache",
|
|
84
|
+
"FastFanoutCache",
|
|
85
|
+
"DjangoCache",
|
|
86
|
+
"rust_pickle_dumps",
|
|
87
|
+
"rust_pickle_loads",
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
# For backward compatibility
|
|
91
|
+
DiskCache = Cache
|