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
Release history Release notifications | RSS feed
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.0.tar.gz
(1.8 kB
view details)
Built Distribution
hdb-0.1.0-py3-none-any.whl
(2.3 kB
view details)
File details
Details for the file hdb-0.1.0.tar.gz
.
File metadata
- Download URL: hdb-0.1.0.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b88936b78ed36b0369b968d8d64fac2542ff1c2515c5d56af84b880d674a5fcf |
|
MD5 | d5c0e3432417788fe1b7be4a887d87d3 |
|
BLAKE2b-256 | 037f672929f6d43454c407f1181b87e7d9e9ea861fe60ae025a66ecae6de03be |
Provenance
File details
Details for the file hdb-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: hdb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04763c78780280b292661ee15d62e08588f9dcf94c8d38dcf941d83bf1afdc21 |
|
MD5 | 1967975b9b0dee16380a7c79705e1071 |
|
BLAKE2b-256 | 5b1061a3eccb6f7aaee0a0faecce83d832a8fa0d0a8963bdeba85a558692a678 |