rust-py-cache 0.1.2__tar.gz → 0.1.3__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.
Files changed (23) hide show
  1. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/Cargo.lock +1 -1
  2. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/Cargo.toml +1 -1
  3. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/PKG-INFO +1 -1
  4. rust_py_cache-0.1.3/ROADMAP.md +90 -0
  5. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/pyproject.toml +1 -1
  6. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/python/rust_py_cache/__init__.py +1 -1
  7. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/.github/workflows/ci.yml +0 -0
  8. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/.github/workflows/release.yml +0 -0
  9. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/.gitignore +0 -0
  10. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/PUBLISHING.md +0 -0
  11. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/README.md +0 -0
  12. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/examples/django_example.py +0 -0
  13. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/examples/fastapi_example.py +0 -0
  14. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/python/rust_py_cache/decorators.py +0 -0
  15. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/src/cache.rs +0 -0
  16. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/src/entry.rs +0 -0
  17. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/src/lib.rs +0 -0
  18. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/src/stats.rs +0 -0
  19. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/src/ttl.rs +0 -0
  20. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/tests/test_cache_basic.py +0 -0
  21. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/tests/test_delete.py +0 -0
  22. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/tests/test_features.py +0 -0
  23. {rust_py_cache-0.1.2 → rust_py_cache-0.1.3}/tests/test_set_get.py +0 -0
@@ -202,7 +202,7 @@ dependencies = [
202
202
 
203
203
  [[package]]
204
204
  name = "rust_py_cache"
205
- version = "0.1.2"
205
+ version = "0.1.3"
206
206
  dependencies = [
207
207
  "dashmap",
208
208
  "pyo3",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "rust_py_cache"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  edition = "2021"
5
5
  readme = "README.md"
6
6
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rust-py-cache
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: Implementation :: CPython
@@ -0,0 +1,90 @@
1
+ # Roadmap — rust-py-cache
2
+
3
+ Direction for `rust-py-cache`: an ultra-fast, process-local cache for Python with
4
+ a Rust core (PyO3 + maturin). The MVP is intentionally small; this document tracks
5
+ the stages already shipped and what comes next.
6
+
7
+ > Status legend: ✅ shipped · 🔜 planned (next) · 💡 idea (no version yet) · ⚠️ note
8
+
9
+ ---
10
+
11
+ ## Shipped — v0.1.x (current: 0.1.2)
12
+
13
+ - ✅ `Cache` with `set` / `get(default=...)` / `delete` / `exists` / `keys` /
14
+ `len` / `clear` / `cleanup_expired` / `stats`.
15
+ - ✅ TTL per entry with **lazy expiration** (expired keys are dropped on access or
16
+ via `cleanup_expired()`).
17
+ - ✅ Cumulative `stats()` (`hits, misses, sets, deletes, expired, size`) backed by
18
+ `AtomicU64` — no global lock on the hot path.
19
+ - ✅ Memoization decorator `@cache.cached(ttl=..., key=...)` (fixed string or
20
+ callable key).
21
+ - ✅ Rust core on `DashMap` (per-shard locks); values serialized with `pickle` and
22
+ stored as opaque bytes (`Vec<u8>`).
23
+ - ✅ Examples for FastAPI and Django.
24
+
25
+ ---
26
+
27
+ ## Planned
28
+
29
+ ### v0.2 — Background expiration
30
+
31
+ - 🔜 Optional background sweeper thread to reclaim expired entries proactively,
32
+ configurable via the constructor (e.g. `Cache(cleanup_interval=...)`), instead
33
+ of relying only on lazy expiration / manual `cleanup_expired()`.
34
+ - 🔜 Keep the sweeper opt-in and lock-friendly (sweep shard by shard) so it never
35
+ stalls the hot path.
36
+
37
+ ### v0.3 — LRU eviction
38
+
39
+ - 🔜 `Cache(max_size=...)` with **least-recently-used** eviction once the cap is hit.
40
+ - 🔜 Track recency cheaply (avoid a global lock); surface evictions in `stats()`
41
+ (e.g. an `evicted` counter).
42
+
43
+ ### v0.4 — LFU eviction
44
+
45
+ - 🔜 **Least-frequently-used** eviction policy as an alternative to LRU, selectable
46
+ at construction time (e.g. `Cache(max_size=..., policy="lfu")`).
47
+
48
+ ### v0.5 — Configurable serializer
49
+
50
+ - 🔜 Pluggable serialization instead of hard-coded `pickle`: e.g.
51
+ `Cache(serializer="json" | "pickle" | "msgpack")` or a custom
52
+ encode/decode pair.
53
+ - ⚠️ Security: `pickle` must not deserialize untrusted data — a JSON/MessagePack
54
+ option makes the cache safe to share across trust boundaries.
55
+
56
+ ### v0.6 — Namespaces
57
+
58
+ - 🔜 Logical key namespaces (e.g. `cache.namespace("users")`) so independent
59
+ features can share one `Cache` instance without key collisions, with per-namespace
60
+ `clear()` and stats.
61
+
62
+ ---
63
+
64
+ ## Ideas / future (no version assigned)
65
+
66
+ - 💡 Prometheus metrics exporter (align with `rust-py-monitor`).
67
+ - 💡 Redis synchronization / a distributed tier (today the cache is process-local).
68
+ - 💡 ImmutableLog integration for eviction events
69
+ (`{"event_type": "cache_evicted", "key": ..., "reason": ...}`).
70
+ - 💡 Binary value formats end-to-end (MessagePack / CBOR / Bincode) for smaller,
71
+ faster payloads.
72
+ - 💡 Benchmarks suite (throughput vs. `dict`, `cachetools`, in-process Redis).
73
+
74
+ ---
75
+
76
+ ## Known limitations (by design, for now)
77
+
78
+ - Process-local: multiple workers = multiple independent caches.
79
+ - Not a replacement for Redis in distributed setups.
80
+ - Data is lost on process restart.
81
+ - Lazy TTL: expired items may linger until accessed or `cleanup_expired()` runs
82
+ (addressed by v0.2).
83
+
84
+ ---
85
+
86
+ ## Contributing to the roadmap
87
+
88
+ Versions and ordering are indicative and may shift. Bump the version in **both**
89
+ `Cargo.toml` and `pyproject.toml` (kept in sync) plus `__version__`, ship tests
90
+ (`cargo test` + `pytest`), then tag `vX.Y.Z` to trigger the release workflow.
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "rust-py-cache"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  description = "An ultra-fast local cache for Python, powered by Rust."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -19,4 +19,4 @@ class Cache(_RustCache):
19
19
 
20
20
 
21
21
  __all__ = ["Cache", "hello"]
22
- __version__ = "0.1.1"
22
+ __version__ = "0.1.3"
File without changes
File without changes
File without changes
File without changes