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.
@@ -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