pdict has a dictionary like interface and a sqlite backend
Project description
pdict has a dictionary like interface and a sqlite backend. It uses pickle to store Python objects and strings, which are then compressed with zlib for storage in sqlite. Multithreaded interaction is supported.
Depends on python 2.5+
Example use:
>>> filename = 'cache.db'
>>> cache = pdict.PersistentDict(filename)
>>> url = 'http://google.com/abc'
>>> html = '<html>abc</html>'
>>>
>>> url in cache
False
>>> cache[url] = html
>>> url in cache
True
>>> cache[url] == html
True
>>> cache.get(url)['value'] == html
True
>>> now = datetime.datetime.now()
>>> cache.meta(url)
{}
>>> cache.meta(url, 'meta')
>>> cache.meta(url)
'meta'
>>> del cache[url]
>>> url in cache
False
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
pdict-1.3.tar.gz
(3.4 kB
view details)
File details
Details for the file pdict-1.3.tar.gz.
File metadata
- Download URL: pdict-1.3.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a8080ab6765df6071f4d5426c5eb05ef76a240ad756ad167c1c78251ed4abc4
|
|
| MD5 |
3dae0d469fda6bf25aa9bac313097756
|
|
| BLAKE2b-256 |
a654091fd19671760f03b21d9f34a9b79f013e5737a3880dbeb913fbd34ccbef
|