mirror of
https://github.com/RGBCube/JsonWrapper
synced 2025-07-27 11:47:45 +00:00
Update README.md
This commit is contained in:
parent
e25f89a7e6
commit
29c72d7377
1 changed files with 24 additions and 0 deletions
24
README.md
24
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()
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue