Skip to main content

Persistent, hobbit-sized dictionaries

Project description

Persistent, hobbit-sized dictionaries

Example Usage

import os
import hdb

# Create a hobbit dictionary at location `pack`.
pack = hdb.get('pack')

# Set a key value pair.
pack['food'] = 'lembas'

# Persist the dictionary to disk.
pack.save()

# Confirm that the dictionary was saved.
# The `location` specifies the path on disk.
print(pack.location)
print(os.path.abspath(pack.location))
print(os.path.exists(pack.location))

We can later retrieve the dictionary like so:

import hdb

new_session = hdb.get('pack')
print(new_session)

# We can then further edit the data, and store it to the same location.
new_session['supplies'] = 'taters'
new_session.save()

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

hdb-0.1.1.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

hdb-0.1.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file hdb-0.1.1.tar.gz.

File metadata

  • Download URL: hdb-0.1.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for hdb-0.1.1.tar.gz
Algorithm Hash digest
SHA256 241989cdcedd3fbf04e1485fb16c7a821a6fa46c6d10ff76cdfdf166605f4a13
MD5 1abc9637ce137e5cc22b7321b59b4b89
BLAKE2b-256 6aa31ed4d2d33caa04a5ce78713a3e14e8fdbebc74da9daa49c4f2381e7eb5b2

See more details on using hashes here.

File details

Details for the file hdb-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hdb-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for hdb-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4d559f242037f808523a304d394203aff1ca52f65a1949fca3000ed8f2d2b34a
MD5 c82dc961bb20f08a776908adf8ba2cb3
BLAKE2b-256 d11fcea46c1f55d8b777daf6dbb738304f81d6f4c2cb8167623b7d0e7cfd0fba

See more details on using hashes here.

Supported by

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