collections-cache 0.3.6.20250420__tar.gz → 0.3.8.20250420__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.
- {collections_cache-0.3.6.20250420 → collections_cache-0.3.8.20250420}/PKG-INFO +1 -1
- {collections_cache-0.3.6.20250420 → collections_cache-0.3.8.20250420}/collections_cache/collections_cache.py +10 -10
- {collections_cache-0.3.6.20250420 → collections_cache-0.3.8.20250420}/pyproject.toml +1 -1
- {collections_cache-0.3.6.20250420 → collections_cache-0.3.8.20250420}/LICENSE +0 -0
- {collections_cache-0.3.6.20250420 → collections_cache-0.3.8.20250420}/README.md +0 -0
- {collections_cache-0.3.6.20250420 → collections_cache-0.3.8.20250420}/collections_cache/__init__.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: collections-cache
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.8.20250420
|
4
4
|
Summary: collections-cache is a Python package for managing data collections across multiple SQLite databases. It allows efficient storage, retrieval, and updating of key-value pairs, supporting various data types serialized with pickle. The package uses parallel processing for fast access and manipulation of large collections.
|
5
5
|
License: MIT
|
6
6
|
Author: Luiz-Trindade
|
@@ -78,21 +78,15 @@ class Collection_Cache:
|
|
78
78
|
if type_of_operation == "set_key" and len(self.temp_keys_values) >= self.size_limit:
|
79
79
|
self.set_multi_keys(self.temp_keys_values)
|
80
80
|
self.temp_keys_values = {}
|
81
|
-
elif type_of_operation == "get_key":
|
82
|
-
self.set_multi_keys(self.temp_keys_values)
|
83
|
-
self.temp_keys_values = {}
|
84
|
-
elif type_of_operation == "set_key_force":
|
81
|
+
elif type_of_operation == "get_key" or type_of_operation == "set_key_force":
|
85
82
|
self.set_multi_keys(self.temp_keys_values)
|
86
83
|
self.temp_keys_values = {}
|
87
84
|
|
88
85
|
# Experimental
|
89
86
|
def set_key(self, key: str, value: any):
|
90
87
|
"""Used to store values and associate a value with a key."""
|
91
|
-
self.temp_keys_values[key]
|
92
|
-
|
93
|
-
|
94
|
-
t = Thread(target=self.verify_size_of_temp_queue, args=("set_key",))
|
95
|
-
t.start()
|
88
|
+
self.temp_keys_values[key] = value
|
89
|
+
self.verify_size_of_temp_queue("set_key")
|
96
90
|
|
97
91
|
def set_key_exec(self, key: str, value: any):
|
98
92
|
"""Used to store values and associate a value with a key."""
|
@@ -120,6 +114,12 @@ class Collection_Cache:
|
|
120
114
|
with Thread(self.cpu_cores) as thread:
|
121
115
|
thread.map(lambda kv: self.set_key_exec(kv[0], kv[1]), keys_and_values.items())
|
122
116
|
|
117
|
+
# New feature
|
118
|
+
def set_key_force(self, key: str, value: any):
|
119
|
+
"""Used to force a unique key to be stored"""
|
120
|
+
self.set_key(key, value)
|
121
|
+
self.verify_size_of_temp_queue("set_key_force")
|
122
|
+
|
123
123
|
def add_to_keys_database(self, key, database):
|
124
124
|
self.keys_databases[key] = database
|
125
125
|
|
@@ -179,7 +179,7 @@ class Collection_Cache:
|
|
179
179
|
def export_to_json(self):
|
180
180
|
"""Test"""
|
181
181
|
pass
|
182
|
-
|
182
|
+
|
183
183
|
def shutdown(self):
|
184
184
|
"""Save all keys to the collection before close or shutdown"""
|
185
185
|
self.verify_size_of_temp_queue("set_key_force")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "collections-cache"
|
3
|
-
version = "0.3.
|
3
|
+
version = "0.3.8.20250420"
|
4
4
|
description = "collections-cache is a Python package for managing data collections across multiple SQLite databases. It allows efficient storage, retrieval, and updating of key-value pairs, supporting various data types serialized with pickle. The package uses parallel processing for fast access and manipulation of large collections."
|
5
5
|
authors = ["Luiz-Trindade <luiz.gabriel.m.trindade@gmail.com>"]
|
6
6
|
license = "MIT"
|
File without changes
|
File without changes
|
{collections_cache-0.3.6.20250420 → collections_cache-0.3.8.20250420}/collections_cache/__init__.py
RENAMED
File without changes
|