Skip to main content

A simple serializable dict

Project description

Serializable Dict

https://img.shields.io/pypi/v/serializabledict.svg https://travis-ci.org/starofrainnight/serializabledict.svg https://ci.appveyor.com/api/projects/status/github/starofrainnight/serializabledict?svg=true

A simple serializable dict

  • License: Apache-2.0

Features

  • Save dict data while it’s changed in realtime, so data will safety saved to file system if script crashed suddenly.

  • Support context recursively save, data will only be saved during last __exit__.

Usage

from serializabledict.storage.yamlfilestorage import YamlFileStorage
from serializabledict import SerializableDict

storage = YamlFileStorage("./test.yml")
adict = SerializableDict(storage=storage)

# Auto save
adict.load()
adict["item"] = 13 # Saved to test.yml automaticly.

# Batch save, saved to test.yml after 'with' finish
with adict:
    adict["item"] = 14
    adict["item2"] = 15
    adict["item3"] = 16

Credits

This package was created with Cookiecutter and the PyPackageTemplate project template.

History

0.0.5 (2018-07-12)

  • Dropped support of python 2.x

  • Refactor setup routines

0.0.4 (2018-06-25)

  • First release on PyPI.

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

serializabledict-0.0.5.zip (14.6 kB view details)

Uploaded Source

File details

Details for the file serializabledict-0.0.5.zip.

File metadata

File hashes

Hashes for serializabledict-0.0.5.zip
Algorithm Hash digest
SHA256 770169108373c913612c2f00f9e72d18984069a8ae4701c5884556cdecff70ae
MD5 247921f70dff2488a2765020594f70ee
BLAKE2b-256 c4c5250d72d63ba7632796652b65e0b6533fe7b6a685472f2c6aaff007ce6745

See more details on using hashes here.

Provenance

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