Skip to content

disentcorp/perdict

Repository files navigation

perdict

Coverage Status

Super simple Persistent dictionary. Key-value pairs are stored on disk in a file. Also supports "dot-notation".

If no filename is specified stored ~/.perdict/globals.cpkl. Serialization is courtesy of cloudpickle.

Install

$> pip install perdict
$> python

Usage

>>> from perdict import Perdict
>>> d = Perdict()
>>> d["my key"] = 3
>>> quit()
$> python
>>> from perdict import Perdict
>>> d = Perdict()
>>> d["my key"]
3

Dot notation

>>> from perdict import Perdict
>>> d = Perdict()
>>> d.new_key = 3  # all user keys with spaces are interpreted as underscore (`_`).
>>> d["new key"]
3

Why use this?

  • Variable storage
  • Settings module
  • Data storage module