1
Fork 0
mirror of https://github.com/RGBCube/JsonWrapper synced 2025-07-27 11:47:45 +00:00
This commit is contained in:
RGBCube 2022-01-21 15:26:21 +03:00 committed by GitHub
parent 06facd0520
commit b2864bab04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,13 +14,15 @@ if the `pathmagic` kwarg is given, it will spit it by the `+`'s and make dicts(o
## `db.get(key: str, *, default=None, pathmagic="")` ## `db.get(key: str, *, default=None, pathmagic="")`
Returns the value of the key in the json, if the key isn't set in the json, it returns the default kwarg. Returns the value of the key in the json, if the key isn't set in the json, it returns the default kwarg.
if the `pathmagic` kwarg is given, it will spit it by the `+`'s and follow the path in it in the JSON data, will return the `default` kwarg if the path is empty or has a value that isnt a dict. if the `pathmagic` kwarg is given, it will spit it by the `+`'s and follow the path in it in the JSON data, it will return the `default` kwarg if the path is empty or has a value that isnt a dict.
## `db.all()` ## `db.all()`
Returns all the JSON data. Returns all the JSON data.
## `db.rem(key: str)` ## `db.rem(key: str, *, pathmagic="")`
Removes the key and value pair from the JSON. Removes the key and value pair from the JSON.
Note that this will not do anything if the key isn't set in the JSON. Note that this will not do anything if the key isn't set in the JSON.
if the `pathmagic` kwarg is given, it will spit it by the `+`'s and follow the path in it in the JSON data, then it will remove the key and value pair.
## `db.nuke()` ## `db.nuke()`
Deletes everything in the JSON. Deletes everything in the JSON.