Skip to main content

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.4.1.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file pdict-1.4.1.tar.gz.

File metadata

  • Download URL: pdict-1.4.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3

File hashes

Hashes for pdict-1.4.1.tar.gz
Algorithm Hash digest
SHA256 b066a429b4814c3bf923f88deeea95900e6397d327a6772c81cda2694d684a81
MD5 d109d3cf906784891ec0b18bc63df9aa
BLAKE2b-256 04bbefadb8007013184188dfbe771040ef817d756bb885af31aab61e76bcfb7d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page