Description
Добавляет возможность глобально управлять объектом dict сохраняя его в файл
Installation
(PyPi)
pip install global_storage_json_dict
Usage
example global storage
from global_storage_json_dict import Storage import
def f(n):
return (((n+1)*n) // 2) + 1
for i in range(40, 100):
if str(i) not in Storage:
Storage[str(i)] = f(i)
if i == 10:
break
example factory
from global_storage_json_dict import FileJsonStorage
storage = FileJsonStorage(file="store.json" auto_save=False)
storage.get('a') # Get value by key default None
storage['a'] = 1 # Set value
storage['b'] = 2
'a' in storage
storage.save() # Save storage
Metadata
Release files for global-storage-json-dict 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| global_storage_json_dict-1.0.2.tar.gz | 2.6 kB | Details |
Release files / global_storage_json_dict-1.0.2.tar.gz
| Download URL | global_storage_json_dict-1.0.2.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99125d32f2d114ad410cfd51883c30c0e815730fd163762ca58ec8045ea03ad9
|
|
BLAKE2b-256 checksum How to use checksums |
ae8e63ea8532f978faa038a74877fed39d4bc10a7545719e7ac3233d44df1e8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.7
|