Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pdamoc/pdicts
Persistent Dictionaries for Python
https://github.com/pdamoc/pdicts
Last synced: 16 days ago
JSON representation
Persistent Dictionaries for Python
- Host: GitHub
- URL: https://github.com/pdamoc/pdicts
- Owner: pdamoc
- Created: 2011-11-22T08:51:05.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2011-11-22T13:05:07.000Z (about 13 years ago)
- Last Synced: 2024-11-19T08:51:35.722Z (about 1 month ago)
- Homepage:
- Size: 97.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
**pdict** is an implementation of a persistent dictionary using sqlite3 and json libraries.
The library is silly and it sucks and as such it shouldn't be used by anyone. :)## Install
Just download [pdicts.py](https://raw.github.com/pdamoc/pdicts/master/pdicts.py) and put it somewhere where you software can find it (e.g. same directory)
## Usage Example
```python
from pdicts import PersistentDict
d = PersistentDict("storage.sqlite")#testing some adds
d['mission'] = "Let the beauty of what you love be what you do"
d['years_active'] = [2010, 2011, 2012]print d.keys() #testing the saved keys
print d['mission'] #testing a simple get
print d['hate'] #testing a missing key
```## Sucking Less
If you see simple ways this library could suck less, please feel free to contribute your ideas.