No project description provided
Project description
Description
Добавляет возможность глобально управлять объектом dict сохраняя его в файл
Installation
(PyPi)
pip install global_storage_json_dict
Usage
example global storage
from from Storage import global_storage_json_dict
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 from FileJsonStorage import global_storage_json_dict
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a0aa6b796db219171dba29a463e62ee2a4a09412ef71ce93316cacbf6fee402 |
|
MD5 | da75ab1a461eb7e67f64edd3204f30e8 |
|
BLAKE2b-256 | 349382413040c5d238da624945d9c7c14d38702357046b75077f814a40ce0e75 |