persidict 0.17.3__py3-none-any.whl → 0.18.0__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.
Potentially problematic release.
This version of persidict might be problematic. Click here for more details.
- persidict/.DS_Store +0 -0
- persidict/file_dir_dict.py +8 -1
- persidict/persi_dict.py +6 -0
- persidict/s3_dict.py +9 -0
- {persidict-0.17.3.dist-info → persidict-0.18.0.dist-info}/METADATA +2 -2
- persidict-0.18.0.dist-info/RECORD +11 -0
- {persidict-0.17.3.dist-info → persidict-0.18.0.dist-info}/WHEEL +1 -1
- persidict-0.17.3.dist-info/RECORD +0 -10
persidict/.DS_Store
ADDED
|
Binary file
|
persidict/file_dir_dict.py
CHANGED
|
@@ -12,6 +12,7 @@ from __future__ import annotations
|
|
|
12
12
|
import os
|
|
13
13
|
import random
|
|
14
14
|
import time
|
|
15
|
+
from abc import abstractmethod
|
|
15
16
|
from typing import Any, Optional
|
|
16
17
|
|
|
17
18
|
import joblib
|
|
@@ -110,6 +111,7 @@ class FileDirDict(PersiDict):
|
|
|
110
111
|
|
|
111
112
|
return repr_str
|
|
112
113
|
|
|
114
|
+
|
|
113
115
|
def get_params(self):
|
|
114
116
|
"""Return configuration parameters of the dictionary."""
|
|
115
117
|
params = super().get_params()
|
|
@@ -119,9 +121,14 @@ class FileDirDict(PersiDict):
|
|
|
119
121
|
params.update(additional_params)
|
|
120
122
|
return params
|
|
121
123
|
|
|
124
|
+
@property
|
|
125
|
+
def base_url(self) -> str:
|
|
126
|
+
"""Return dictionary's URL"""
|
|
127
|
+
return f"file://{self.base_dir}"
|
|
128
|
+
|
|
122
129
|
|
|
123
130
|
def __len__(self) -> int:
|
|
124
|
-
""" Get number of key-value pairs in the dictionary."""
|
|
131
|
+
""" Get the number of key-value pairs in the dictionary."""
|
|
125
132
|
|
|
126
133
|
num_files = 0
|
|
127
134
|
suffix = "." + self.file_type
|
persidict/persi_dict.py
CHANGED
|
@@ -102,6 +102,12 @@ class PersiDict(MutableMapping, ParameterizableClass):
|
|
|
102
102
|
)
|
|
103
103
|
return params
|
|
104
104
|
|
|
105
|
+
@property
|
|
106
|
+
@abstractmethod
|
|
107
|
+
def base_url(self):
|
|
108
|
+
"""Return dictionary's URL"""
|
|
109
|
+
raise NotImplementedError
|
|
110
|
+
|
|
105
111
|
|
|
106
112
|
def __repr__(self) -> str:
|
|
107
113
|
"""Return repr(self)"""
|
persidict/s3_dict.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
+
from abc import abstractmethod
|
|
4
5
|
from typing import Any, Optional
|
|
5
6
|
|
|
6
7
|
import boto3
|
|
@@ -107,6 +108,7 @@ class S3Dict(PersiDict):
|
|
|
107
108
|
|
|
108
109
|
return repr_str
|
|
109
110
|
|
|
111
|
+
|
|
110
112
|
def get_params(self):
|
|
111
113
|
"""Return configuration parameters of the object as a dictionary."""
|
|
112
114
|
params = self.local_cache.get_params()
|
|
@@ -116,6 +118,13 @@ class S3Dict(PersiDict):
|
|
|
116
118
|
return params
|
|
117
119
|
|
|
118
120
|
|
|
121
|
+
@property
|
|
122
|
+
def base_url(self):
|
|
123
|
+
"""Return dictionary's URl"""
|
|
124
|
+
return f"s3://{self.bucket_name}/{self.root_prefix}"
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
119
128
|
def _build_full_objectname(self, key:PersiDictKey) -> str:
|
|
120
129
|
""" Convert PersiDictKey into an S3 objectname. """
|
|
121
130
|
key = SafeStrTuple(key)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: persidict
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.18.0
|
|
4
4
|
Summary: Simple persistent key-value store for Python. Values are stored as files on a disk or as S3 objects on AWS cloud.
|
|
5
5
|
Keywords: persistence,dicts,distributed,parallel
|
|
6
6
|
Author: Vlad (Volodymyr) Pavlov
|
|
@@ -201,7 +201,7 @@ Binary installers for the latest released version are available at the Python pa
|
|
|
201
201
|
|
|
202
202
|
Using uv :
|
|
203
203
|
```
|
|
204
|
-
uv
|
|
204
|
+
uv add persidict
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
Using pip (legacy alternative to uv):
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
persidict/.DS_Store,sha256=d65165279105ca6773180500688df4bdc69a2c7b771752f0a46ef120b7fd8ec3,6148
|
|
2
|
+
persidict/__init__.py,sha256=f589b6292bef0ee7c6f6ef087dacbecc5943a64deed8839b02f8342db3032b25,1155
|
|
3
|
+
persidict/file_dir_dict.py,sha256=b978200dd48fa77a7b15bc05327d5aa773cc09974e138a581da0a784d0448903,13906
|
|
4
|
+
persidict/persi_dict.py,sha256=cea37db3dcd209e5a4ab382e668fad67ac97b56ef829e8466b60eccc8f771eb6,11431
|
|
5
|
+
persidict/s3_dict.py,sha256=93d8a7945c565adf8aa513568a4dde3b06772e2366acbdfc3402c063aade17ef,11581
|
|
6
|
+
persidict/safe_chars.py,sha256=59a20e96205d2e5675d827a911ad42ddbd553f1bd7e2cda1be765a9c2c4ce814,565
|
|
7
|
+
persidict/safe_str_tuple.py,sha256=71393904bdebfb213ad8429fed59e04da52964076c01324f2238821aa4339325,3717
|
|
8
|
+
persidict/safe_str_tuple_signing.py,sha256=e6e0a3015651a8ea2ef8aa43670f84c5ba1cdfedefb9ac8932aaebb7c699d1c9,3742
|
|
9
|
+
persidict-0.18.0.dist-info/WHEEL,sha256=c133ef911c90b05f7e14d8679ba99146f9154fcd271b7398cf8f672283b94e05,79
|
|
10
|
+
persidict-0.18.0.dist-info/METADATA,sha256=3567ed443b76bb83e481945ef1bfd6b20647db3f178d81022b6234d574242aa9,9096
|
|
11
|
+
persidict-0.18.0.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
persidict/__init__.py,sha256=f589b6292bef0ee7c6f6ef087dacbecc5943a64deed8839b02f8342db3032b25,1155
|
|
2
|
-
persidict/file_dir_dict.py,sha256=d1f85ace6909dddd95ac90cd8c8113e27e0faec53c70d51906510a8a14f67fd6,13745
|
|
3
|
-
persidict/persi_dict.py,sha256=5d1b3a0426b066e917c5032ae56c22b54063739c0b2da56635fb05b662644b6d,11300
|
|
4
|
-
persidict/s3_dict.py,sha256=223b465f18b0f08c87490eff698570c781590ff16a7fde525658ba1eb0744379,11409
|
|
5
|
-
persidict/safe_chars.py,sha256=59a20e96205d2e5675d827a911ad42ddbd553f1bd7e2cda1be765a9c2c4ce814,565
|
|
6
|
-
persidict/safe_str_tuple.py,sha256=71393904bdebfb213ad8429fed59e04da52964076c01324f2238821aa4339325,3717
|
|
7
|
-
persidict/safe_str_tuple_signing.py,sha256=e6e0a3015651a8ea2ef8aa43670f84c5ba1cdfedefb9ac8932aaebb7c699d1c9,3742
|
|
8
|
-
persidict-0.17.3.dist-info/WHEEL,sha256=ec89e25a684ec3ad8fb2a9be806e47666a27f7dcdcf9b55bff3f1d3ed5e60e0a,78
|
|
9
|
-
persidict-0.17.3.dist-info/METADATA,sha256=fda1045f1978429114b3bd43f4fbf096f451e071f1c3e25957f68db575aedd4a,9100
|
|
10
|
-
persidict-0.17.3.dist-info/RECORD,,
|