Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hdb

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hdb

Persistent, hobbit-sized dictionaries

  • 0.1.1
  • PyPI
  • Socket score

Maintainers
1

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()

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc