collections-cache 0.3.4.20250419__tar.gz → 0.3.5.20250419__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: collections-cache
3
- Version: 0.3.4.20250419
3
+ Version: 0.3.5.20250419
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
@@ -126,9 +126,13 @@ class Collection_Cache:
126
126
 
127
127
  def get_key(self, key: str):
128
128
  """Used to obtain the value stored by the key"""
129
- self.get_all_databases()
130
- self.verify_size_of_temp_queue("get_key")
131
129
  try:
130
+ if key not in self.keys_databases:
131
+ self.verify_size_of_temp_queue("get_key")
132
+
133
+ if key not in self.keys_databases:
134
+ return None
135
+
132
136
  database_to_search = self.keys_databases[key]
133
137
  conn = sqlite3.connect(database_to_search)
134
138
  self.configure_connection(conn)
@@ -136,8 +140,12 @@ class Collection_Cache:
136
140
  cursor.execute("SELECT value FROM data WHERE key = ?", (key,))
137
141
  result = cursor.fetchall()
138
142
  conn.close()
139
- return pickle.loads(result[0][0])
140
-
143
+
144
+ #return pickle.loads(result[0][0])
145
+ if result:
146
+ return pickle.loads(result[0][0])
147
+ return None
148
+
141
149
  except Exception as error:
142
150
  return None
143
151
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "collections-cache"
3
- version = "0.3.4.20250419"
3
+ version = "0.3.5.20250419"
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"