Skip to content

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

A helper script for easy 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

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages