资 源 简 介
`pdict` is a simple module that provides a `dict`-like type called `PersistentDict` which will persist the dictionary to a database of your choice.
Whenever an items is requested, added, changed, or removed, the data is read from/written to a database. The values in the dict can be an object of any type that is serializable by the `pickle` module.
This is handy for when you want to save preferences, current state and other data between uses of your program.
Usage is very simple, for example:
```
>>> from pdict import PersistentDict
>>> cfg = PersistentDict("testfile.cfg")
>>> cfg["test1"] = "testval1"
>>> cfg["test2"] = "testval2"
>>> print cfg
{"test1": "testval1", "test2": "testval2"}
>>>
```
To install the `pdict` module, just download the the tarball or checkout the source and move the `pdict` directory to somewhere accessible by Python. There should be a proper installer and/or egg in the next few revisions.