collections-cache 0.3.4.20250419__py3-none-any.whl → 0.3.5.20250420__py3-none-any.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.
- collections_cache/collections_cache.py +14 -5
- {collections_cache-0.3.4.20250419.dist-info → collections_cache-0.3.5.20250420.dist-info}/METADATA +1 -1
- collections_cache-0.3.5.20250420.dist-info/RECORD +6 -0
- collections_cache-0.3.4.20250419.dist-info/RECORD +0 -6
- {collections_cache-0.3.4.20250419.dist-info → collections_cache-0.3.5.20250420.dist-info}/LICENSE +0 -0
- {collections_cache-0.3.4.20250419.dist-info → collections_cache-0.3.5.20250420.dist-info}/WHEEL +0 -0
@@ -13,7 +13,8 @@ class Collection_Cache:
|
|
13
13
|
self.collection_name = collection_name
|
14
14
|
self.constant_per_core = constant_per_core
|
15
15
|
self.cpu_cores = cpu_count()
|
16
|
-
self.size_limit = self.constant_per_core * self.cpu_cores
|
16
|
+
#self.size_limit = self.constant_per_core * self.cpu_cores
|
17
|
+
self.size_limit = 1
|
17
18
|
self.collection_dir = path.join("./Collections", self.collection_name)
|
18
19
|
self.databases_list = []
|
19
20
|
self.keys_databases = {}
|
@@ -126,9 +127,13 @@ class Collection_Cache:
|
|
126
127
|
|
127
128
|
def get_key(self, key: str):
|
128
129
|
"""Used to obtain the value stored by the key"""
|
129
|
-
self.get_all_databases()
|
130
|
-
self.verify_size_of_temp_queue("get_key")
|
131
130
|
try:
|
131
|
+
if key not in self.keys_databases:
|
132
|
+
self.verify_size_of_temp_queue("get_key")
|
133
|
+
|
134
|
+
if key not in self.keys_databases:
|
135
|
+
return None
|
136
|
+
|
132
137
|
database_to_search = self.keys_databases[key]
|
133
138
|
conn = sqlite3.connect(database_to_search)
|
134
139
|
self.configure_connection(conn)
|
@@ -136,8 +141,12 @@ class Collection_Cache:
|
|
136
141
|
cursor.execute("SELECT value FROM data WHERE key = ?", (key,))
|
137
142
|
result = cursor.fetchall()
|
138
143
|
conn.close()
|
139
|
-
|
140
|
-
|
144
|
+
|
145
|
+
#return pickle.loads(result[0][0])
|
146
|
+
if result:
|
147
|
+
return pickle.loads(result[0][0])
|
148
|
+
return None
|
149
|
+
|
141
150
|
except Exception as error:
|
142
151
|
return None
|
143
152
|
|
{collections_cache-0.3.4.20250419.dist-info → collections_cache-0.3.5.20250420.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: collections-cache
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.5.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
|
@@ -0,0 +1,6 @@
|
|
1
|
+
collections_cache/__init__.py,sha256=uUp8lhp-HnZRumnU_8MT6qVq95t0pOzn7oLW7ARbnvc,48
|
2
|
+
collections_cache/collections_cache.py,sha256=Rdxnw-Wm1ThiIP0FS8Tlc56GzgaU7McuHRgDsQPleQg,6703
|
3
|
+
collections_cache-0.3.5.20250420.dist-info/LICENSE,sha256=RAIL-FmXSiNRgyiVlfhm2SvVI4XDVsN0jDt9207SJ8o,1168
|
4
|
+
collections_cache-0.3.5.20250420.dist-info/METADATA,sha256=D6rq1g7fWF7quUVW81Erjk9Pv3kkFyb-xhThqSg3PVo,5770
|
5
|
+
collections_cache-0.3.5.20250420.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
6
|
+
collections_cache-0.3.5.20250420.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
collections_cache/__init__.py,sha256=uUp8lhp-HnZRumnU_8MT6qVq95t0pOzn7oLW7ARbnvc,48
|
2
|
-
collections_cache/collections_cache.py,sha256=mUj52BXn3G2r6Ln9vhpveECuHT55Hc9nYU4kgVdgycY,6420
|
3
|
-
collections_cache-0.3.4.20250419.dist-info/LICENSE,sha256=RAIL-FmXSiNRgyiVlfhm2SvVI4XDVsN0jDt9207SJ8o,1168
|
4
|
-
collections_cache-0.3.4.20250419.dist-info/METADATA,sha256=faDp84_g113TlR-CQVl-1zvj09WCuFtjD_UbztR5XOY,5770
|
5
|
-
collections_cache-0.3.4.20250419.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
6
|
-
collections_cache-0.3.4.20250419.dist-info/RECORD,,
|
{collections_cache-0.3.4.20250419.dist-info → collections_cache-0.3.5.20250420.dist-info}/LICENSE
RENAMED
File without changes
|
{collections_cache-0.3.4.20250419.dist-info → collections_cache-0.3.5.20250420.dist-info}/WHEEL
RENAMED
File without changes
|