New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

localdb.json

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localdb.json

A helper script for easily handling of JSON file as database in local storage.

  • 1.0
  • PyPI
  • Socket score

Maintainers
1

localdb.json

A helper script for easily handling of JSON file as database in local storage.


Installation

  • pip install localdb.json

Usage

Creating instance
from localdb import Database

db = Database("example.json")

Saving some data

This creates a key with the given value. It will overwrite existing key's value. Always returns True.

db.set("TEST", "VALUE")
>>> True

Getting saved data

Returns value of requested key if it exists or will return None.

db.get("TEST")
>>> VALUE

Renaming a key

Renames an existing key to another. Returns True if it exists or will return None.

db.rename("TEST", "Test")
>>> True

Deleting a key

Deletes key and value from database. Returns True if it exists or will return None.

db.delete("Test")
>>> True

Database size

Size of database file is returned in bytes.

db.size
>>> 42

Issues ?

Open issues or ask here

Contributing

Pull requests are welcome.

License

Licensed under GNU Affero General Public License v3.

Credits

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