collections-cache 0.2.2__py3-none-any.whl → 0.2.3__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 +4 -4
- {collections_cache-0.2.2.dist-info → collections_cache-0.2.3.dist-info}/METADATA +1 -1
- collections_cache-0.2.3.dist-info/RECORD +6 -0
- collections_cache-0.2.2.dist-info/RECORD +0 -6
- {collections_cache-0.2.2.dist-info → collections_cache-0.2.3.dist-info}/LICENSE +0 -0
- {collections_cache-0.2.2.dist-info → collections_cache-0.2.3.dist-info}/WHEEL +0 -0
@@ -3,8 +3,8 @@ import sqlite3
|
|
3
3
|
from random import choice
|
4
4
|
from itertools import chain
|
5
5
|
from os import cpu_count, path, makedirs, scandir
|
6
|
-
|
7
|
-
from concurrent.futures import ThreadPoolExecutor as
|
6
|
+
from concurrent.futures import ProcessPoolExecutor as Pool
|
7
|
+
from concurrent.futures import ThreadPoolExecutor as Thread
|
8
8
|
|
9
9
|
class Collection_Cache:
|
10
10
|
def __init__(self, collection_name):
|
@@ -73,8 +73,8 @@ class Collection_Cache:
|
|
73
73
|
|
74
74
|
def set_multi_keys(self, keys_and_values: dict[str, any]):
|
75
75
|
"""Experimental. Set multiple keys and values at the same time."""
|
76
|
-
with
|
77
|
-
|
76
|
+
with Thread(self.cpu_cores) as thread:
|
77
|
+
thread.map(lambda kv: self.set_key(kv[0], kv[1]), keys_and_values.items())
|
78
78
|
|
79
79
|
def add_to_keys_database(self, key, database):
|
80
80
|
self.keys_databases[key] = database
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: collections-cache
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.3
|
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=HWTwxrXsMc3sRcsrRkLugp_QtbBASvem6kBQShMEYO4,5133
|
3
|
+
collections_cache-0.2.3.dist-info/LICENSE,sha256=RAIL-FmXSiNRgyiVlfhm2SvVI4XDVsN0jDt9207SJ8o,1168
|
4
|
+
collections_cache-0.2.3.dist-info/METADATA,sha256=_NbnncpG10Jlw4cwh_p4TgaVD0k18d7AWF07VwyUt3Y,3408
|
5
|
+
collections_cache-0.2.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
6
|
+
collections_cache-0.2.3.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
collections_cache/__init__.py,sha256=uUp8lhp-HnZRumnU_8MT6qVq95t0pOzn7oLW7ARbnvc,48
|
2
|
-
collections_cache/collections_cache.py,sha256=8780rRG8U2R90Yit8k7Xu-yK5U-QAHY8vpoG6Q2FL8E,5126
|
3
|
-
collections_cache-0.2.2.dist-info/LICENSE,sha256=RAIL-FmXSiNRgyiVlfhm2SvVI4XDVsN0jDt9207SJ8o,1168
|
4
|
-
collections_cache-0.2.2.dist-info/METADATA,sha256=cMJlG1baO1jdptLgbN-enSI09rMBcFEJMtkhLrnwj6o,3408
|
5
|
-
collections_cache-0.2.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
6
|
-
collections_cache-0.2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|