1
Fork 0
mirror of https://github.com/RGBCube/JsonWrapper synced 2026-01-17 02:31:05 +00:00
No description
Find a file
2022-01-05 15:20:22 +03:00
db.py Create db.py 2022-01-05 15:15:30 +03:00
README.md Update README.md 2022-01-05 15:20:22 +03:00

ClutterDB

extremely simple JSON database made for infrequent changes which behaves like a dict

Usage

from db import ClutterDB

# initialization
db = ClutterDB("path/to/json/file.json")

# defining a variable 
# (this will overrride the previous a if it was defined before)
db.set("a", 12345)

# getting a variable 
# (default kwarg will be returned if the key was not defined in the json)
data = db.get("a", default="a was not defined in the json")

# prints data
print(data)

# removes the a from the json
db.rem("a")

# nukes the json
db.nuke()