Persistent, hobbit-sized dictionaries
## Example Usage
```python
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:
```python
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()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "hdb",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "hdb hobbit database persistent dictionary json",
"author": "Chris Varga",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/0d/6e/10d9d0212ade23c11d4e14e5a6efc2108706024f64b84560d3ca7e5ae915/hdb-0.1.2.tar.gz",
"platform": null,
"description": "\nPersistent, hobbit-sized dictionaries\n\n## Example Usage\n```python\nimport os\nimport hdb\n\n# Create a hobbit dictionary at location `pack`.\npack = hdb.get('pack')\n\n# Set a key value pair.\npack['food'] = 'lembas'\n\n# Persist the dictionary to disk.\npack.save()\n\n# Confirm that the dictionary was saved.\n# The `location` specifies the path on disk.\nprint(pack.location)\nprint(os.path.abspath(pack.location))\nprint(os.path.exists(pack.location))\n```\n\nWe can later retrieve the dictionary like so:\n```python\nimport hdb\n\nnew_session = hdb.get('pack')\nprint(new_session)\n\n# We can then further edit the data, and store it to the same location.\nnew_session['supplies'] = 'taters'\nnew_session.save()\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "HobbitDB - persistent Python dictionaries",
"version": "0.1.2",
"project_urls": null,
"split_keywords": [
"hdb",
"hobbit",
"database",
"persistent",
"dictionary",
"json"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1ca6d29741e78edff858902a6ce98b4ebaa78f53283a91400e50dc284b5bb4c5",
"md5": "e476a0a429162e5029cd4e6b35105019",
"sha256": "759a4534b4f35c8af1f869f9a26f1febb6ced470baa7e8a3b91d4e488d264dae"
},
"downloads": -1,
"filename": "hdb-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e476a0a429162e5029cd4e6b35105019",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3004,
"upload_time": "2024-08-03T03:08:26",
"upload_time_iso_8601": "2024-08-03T03:08:26.574986Z",
"url": "https://files.pythonhosted.org/packages/1c/a6/d29741e78edff858902a6ce98b4ebaa78f53283a91400e50dc284b5bb4c5/hdb-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0d6e10d9d0212ade23c11d4e14e5a6efc2108706024f64b84560d3ca7e5ae915",
"md5": "dbb68922074965b331933af123f179d2",
"sha256": "ddce92ae6788fff1da3b1bd720aaa005488a54ee03ce9b697ad2f8be4b800c61"
},
"downloads": -1,
"filename": "hdb-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "dbb68922074965b331933af123f179d2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2497,
"upload_time": "2024-08-03T03:08:27",
"upload_time_iso_8601": "2024-08-03T03:08:27.981676Z",
"url": "https://files.pythonhosted.org/packages/0d/6e/10d9d0212ade23c11d4e14e5a6efc2108706024f64b84560d3ca7e5ae915/hdb-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-03 03:08:27",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "hdb"
}