From 29c72d737760abd4de896e3b328e4e9acebcf8b9 Mon Sep 17 00:00:00 2001 From: RGBCube <78925721+RGBCube@users.noreply.github.com> Date: Wed, 5 Jan 2022 15:20:22 +0300 Subject: [PATCH] Update README.md --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index f96e739..10fc587 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,26 @@ # 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() +```