Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

global_storage_json_dict-1.0.2.tar.gz (2.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page