No project description provided
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for global_storage_json_dict-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99125d32f2d114ad410cfd51883c30c0e815730fd163762ca58ec8045ea03ad9 |
|
MD5 | 1c4ad60678fd5072b89bbd3169b59d54 |
|
BLAKE2b-256 | ae8e63ea8532f978faa038a74877fed39d4bc10a7545719e7ac3233d44df1e8e |