collections-cache 0.2.9.20250303__tar.gz → 0.3.0.20250303__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.2.9.20250303 → collections_cache-0.3.0.20250303}/PKG-INFO +1 -1
- {collections_cache-0.2.9.20250303 → collections_cache-0.3.0.20250303}/collections_cache/collections_cache.py +3 -4
- {collections_cache-0.2.9.20250303 → collections_cache-0.3.0.20250303}/pyproject.toml +1 -1
- {collections_cache-0.2.9.20250303 → collections_cache-0.3.0.20250303}/LICENSE +0 -0
- {collections_cache-0.2.9.20250303 → collections_cache-0.3.0.20250303}/README.md +0 -0
- {collections_cache-0.2.9.20250303 → collections_cache-0.3.0.20250303}/collections_cache/__init__.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: collections-cache
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.0.20250303
|
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
|
@@ -5,10 +5,9 @@ from itertools import chain
|
|
5
5
|
from os import cpu_count, path, makedirs, scandir
|
6
6
|
from concurrent.futures import ProcessPoolExecutor as Pool
|
7
7
|
from concurrent.futures import ThreadPoolExecutor as Thread
|
8
|
-
from threading import Thread as Thread_Exec
|
9
8
|
|
10
9
|
class Collection_Cache:
|
11
|
-
def __init__(self, collection_name):
|
10
|
+
def __init__(self, collection_name: str, size_limit:int = 800):
|
12
11
|
# Variables
|
13
12
|
self.collection_name = collection_name
|
14
13
|
self.cpu_cores = cpu_count()
|
@@ -16,7 +15,7 @@ class Collection_Cache:
|
|
16
15
|
self.databases_list = []
|
17
16
|
self.keys_databases = {}
|
18
17
|
self.temp_keys_values = {}
|
19
|
-
self.size_limit =
|
18
|
+
self.size_limit = size_limit
|
20
19
|
|
21
20
|
# Init methods
|
22
21
|
self.create_collection()
|
@@ -73,7 +72,7 @@ class Collection_Cache:
|
|
73
72
|
if type_of_operation == "set_key" and len(self.temp_keys_values) >= self.size_limit:
|
74
73
|
self.set_multi_keys(self.temp_keys_values)
|
75
74
|
self.temp_keys_values = {}
|
76
|
-
|
75
|
+
elif type_of_operation == "get_key":
|
77
76
|
self.set_multi_keys(self.temp_keys_values)
|
78
77
|
self.temp_keys_values = {}
|
79
78
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "collections-cache"
|
3
|
-
version = "0.
|
3
|
+
version = "0.3.0.20250303"
|
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.2.9.20250303 → collections_cache-0.3.0.20250303}/collections_cache/__init__.py
RENAMED
File without changes
|