persidict 0.36.2__tar.gz → 0.36.4__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.

Potentially problematic release.


This version of persidict might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: persidict
3
- Version: 0.36.2
3
+ Version: 0.36.4
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
@@ -38,15 +38,14 @@ Simple persistent dictionaries for distributed applications in Python.
38
38
 
39
39
  ## 1. What Is It?
40
40
 
41
- `persidict` offers a simple persistent key-value store for Python.
42
- It saves the content of the dictionary in a folder on a disk
43
- or in an S3 bucket on AWS. Each value is stored as a separate file / S3 object.
44
- Only text strings or sequences of strings are allowed as keys.
41
+ `persidict` is a lightweight persistent key-value store for Python.
42
+ It saves a dictionary to either a local directory or an AWS S3 bucket,
43
+ storing each value as its own file or S3 object. Keys are limited to
44
+ text strings or sequences of strings.
45
45
 
46
- Unlike other persistent dictionaries (e.g. Python's native `shelve`),
47
- `persidict` is designed for use in highly **distributed environments**,
48
- where multiple instances of a program run concurrently across many machines,
49
- accessing the same dictionary via a shared storage.
46
+ In contrast to traditional persistent dictionaries (e.g., Pythons `shelve)`,
47
+ `persidict` is designed for distributed environments where multiple processes
48
+ on different machines concurrently work with the same store.
50
49
 
51
50
  ## 2. Features
52
51
  * **Persistent Storage**: Save dictionaries to the local filesystem
@@ -206,7 +205,24 @@ dict API, such as `timestamp()`, `random_key()`, `newest_keys()`, `subdicts()`
206
205
  * **Special Values**: Use `KEEP_CURRENT` to avoid updating a value
207
206
  and `DELETE_CURRENT` to delete a value during an assignment.
208
207
 
209
- ## 6. Installation
208
+ ## 6. API Highlights
209
+
210
+ `PersiDict` subclasses support the standard Python dictionary API, plus these additional methods for advanced functionality:
211
+
212
+ | Method | Return Type | Description |
213
+ | :--- | :--- | :--- |
214
+ | `timestamp(key)` | `float` | Returns the POSIX timestamp (seconds since epoch) of a key's last modification. |
215
+ | `random_key()` | `SafeStrTuple \| None` | Selects and returns a single random key, useful for sampling from the dataset. |
216
+ | `oldest_keys(max_n=None)` | `list[SafeStrTuple]` | Returns a list of keys sorted by their modification time, from oldest to newest. |
217
+ | `newest_keys(max_n=None)` | `list[SafeStrTuple]` | Returns a list of keys sorted by their modification time, from newest to oldest. |
218
+ | `oldest_values(max_n=None)` | `list[Any]` | Returns a list of values corresponding to the oldest keys. |
219
+ | `newest_values(max_n=None)` | `list[Any]` | Returns a list of values corresponding to the newest keys. |
220
+ | `get_subdict(prefix_key)` | `PersiDict` | Returns a new `PersiDict` instance that provides a view into a subset of keys sharing a common prefix. |
221
+ | `subdicts()` | `dict[str, PersiDict]` | Returns a dictionary mapping all first-level key prefixes to their corresponding sub-dictionary views. |
222
+ | `delete_if_exists(key)` | `bool` | Deletes a key-value pair if it exists and returns `True`; otherwise, returns `False`. |
223
+ | `get_params()` | `dict` | Returns a dictionary of the instance's configuration parameters, supporting the `parameterizable` API. |
224
+
225
+ ## 7. Installation
210
226
 
211
227
  The source code is hosted on GitHub at:
212
228
  [https://github.com/pythagoras-dev/persidict](https://github.com/pythagoras-dev/persidict)
@@ -232,7 +248,7 @@ For development, including test dependencies:
232
248
  pip install persidict[dev]
233
249
  ```
234
250
 
235
- ## 7. Dependencies
251
+ ## 8. Dependencies
236
252
 
237
253
  `persidict` has the following core dependencies:
238
254
 
@@ -244,20 +260,20 @@ pip install persidict[dev]
244
260
  * [numpy](https://numpy.org)
245
261
  * [deepdiff](https://zepworks.com/deepdiff)
246
262
 
247
- For AWS S3 support (S3Dict), you will also need:
263
+ For AWS S3 support (`S3Dict`), you will also need:
248
264
  * [boto3](https://boto3.readthedocs.io)
249
265
 
250
266
  For development and testing, the following packages are used:
251
267
  * [pytest](https://pytest.org)
252
268
  * [moto](http://getmoto.org)
253
269
 
254
- ## 8. Contributing
270
+ ## 9. Contributing
255
271
  Contributions are welcome! Please see the contributing [guide](https://github.com/pythagoras-dev/persidict?tab=contributing-ov-file) for more details
256
272
  on how to get started, run tests, and submit pull requests.
257
273
 
258
- ## 9. License
274
+ ## 10. License
259
275
  `persidict` is licensed under the MIT License. See the [LICENSE](https://github.com/pythagoras-dev/persidict?tab=MIT-1-ov-file) file for more details.
260
276
 
261
- ## 10. Key Contacts
277
+ ## 11. Key Contacts
262
278
 
263
279
  * [Vlad (Volodymyr) Pavlov](https://www.linkedin.com/in/vlpavlov/)
@@ -4,15 +4,14 @@ Simple persistent dictionaries for distributed applications in Python.
4
4
 
5
5
  ## 1. What Is It?
6
6
 
7
- `persidict` offers a simple persistent key-value store for Python.
8
- It saves the content of the dictionary in a folder on a disk
9
- or in an S3 bucket on AWS. Each value is stored as a separate file / S3 object.
10
- Only text strings or sequences of strings are allowed as keys.
7
+ `persidict` is a lightweight persistent key-value store for Python.
8
+ It saves a dictionary to either a local directory or an AWS S3 bucket,
9
+ storing each value as its own file or S3 object. Keys are limited to
10
+ text strings or sequences of strings.
11
11
 
12
- Unlike other persistent dictionaries (e.g. Python's native `shelve`),
13
- `persidict` is designed for use in highly **distributed environments**,
14
- where multiple instances of a program run concurrently across many machines,
15
- accessing the same dictionary via a shared storage.
12
+ In contrast to traditional persistent dictionaries (e.g., Pythons `shelve)`,
13
+ `persidict` is designed for distributed environments where multiple processes
14
+ on different machines concurrently work with the same store.
16
15
 
17
16
  ## 2. Features
18
17
  * **Persistent Storage**: Save dictionaries to the local filesystem
@@ -172,7 +171,24 @@ dict API, such as `timestamp()`, `random_key()`, `newest_keys()`, `subdicts()`
172
171
  * **Special Values**: Use `KEEP_CURRENT` to avoid updating a value
173
172
  and `DELETE_CURRENT` to delete a value during an assignment.
174
173
 
175
- ## 6. Installation
174
+ ## 6. API Highlights
175
+
176
+ `PersiDict` subclasses support the standard Python dictionary API, plus these additional methods for advanced functionality:
177
+
178
+ | Method | Return Type | Description |
179
+ | :--- | :--- | :--- |
180
+ | `timestamp(key)` | `float` | Returns the POSIX timestamp (seconds since epoch) of a key's last modification. |
181
+ | `random_key()` | `SafeStrTuple \| None` | Selects and returns a single random key, useful for sampling from the dataset. |
182
+ | `oldest_keys(max_n=None)` | `list[SafeStrTuple]` | Returns a list of keys sorted by their modification time, from oldest to newest. |
183
+ | `newest_keys(max_n=None)` | `list[SafeStrTuple]` | Returns a list of keys sorted by their modification time, from newest to oldest. |
184
+ | `oldest_values(max_n=None)` | `list[Any]` | Returns a list of values corresponding to the oldest keys. |
185
+ | `newest_values(max_n=None)` | `list[Any]` | Returns a list of values corresponding to the newest keys. |
186
+ | `get_subdict(prefix_key)` | `PersiDict` | Returns a new `PersiDict` instance that provides a view into a subset of keys sharing a common prefix. |
187
+ | `subdicts()` | `dict[str, PersiDict]` | Returns a dictionary mapping all first-level key prefixes to their corresponding sub-dictionary views. |
188
+ | `delete_if_exists(key)` | `bool` | Deletes a key-value pair if it exists and returns `True`; otherwise, returns `False`. |
189
+ | `get_params()` | `dict` | Returns a dictionary of the instance's configuration parameters, supporting the `parameterizable` API. |
190
+
191
+ ## 7. Installation
176
192
 
177
193
  The source code is hosted on GitHub at:
178
194
  [https://github.com/pythagoras-dev/persidict](https://github.com/pythagoras-dev/persidict)
@@ -198,7 +214,7 @@ For development, including test dependencies:
198
214
  pip install persidict[dev]
199
215
  ```
200
216
 
201
- ## 7. Dependencies
217
+ ## 8. Dependencies
202
218
 
203
219
  `persidict` has the following core dependencies:
204
220
 
@@ -210,20 +226,20 @@ pip install persidict[dev]
210
226
  * [numpy](https://numpy.org)
211
227
  * [deepdiff](https://zepworks.com/deepdiff)
212
228
 
213
- For AWS S3 support (S3Dict), you will also need:
229
+ For AWS S3 support (`S3Dict`), you will also need:
214
230
  * [boto3](https://boto3.readthedocs.io)
215
231
 
216
232
  For development and testing, the following packages are used:
217
233
  * [pytest](https://pytest.org)
218
234
  * [moto](http://getmoto.org)
219
235
 
220
- ## 8. Contributing
236
+ ## 9. Contributing
221
237
  Contributions are welcome! Please see the contributing [guide](https://github.com/pythagoras-dev/persidict?tab=contributing-ov-file) for more details
222
238
  on how to get started, run tests, and submit pull requests.
223
239
 
224
- ## 9. License
240
+ ## 10. License
225
241
  `persidict` is licensed under the MIT License. See the [LICENSE](https://github.com/pythagoras-dev/persidict?tab=MIT-1-ov-file) file for more details.
226
242
 
227
- ## 10. Key Contacts
243
+ ## 11. Key Contacts
228
244
 
229
245
  * [Vlad (Volodymyr) Pavlov](https://www.linkedin.com/in/vlpavlov/)
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "persidict"
7
- version = "0.36.2"
7
+ version = "0.36.4"
8
8
  description = "Simple persistent key-value store for Python. Values are stored as files on a disk or as S3 objects on AWS cloud."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"