1
Fork 0
mirror of https://github.com/RGBCube/JsonWrapper synced 2025-07-27 11:47:45 +00:00

Update README.md

This commit is contained in:
RGBCube 2022-01-28 20:14:03 +03:00 committed by GitHub
parent 0e4a172b8a
commit 259ce297a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,9 +2,19 @@
<!-- will be updated soon --> <!-- will be updated soon -->
# *class* `json_wrapper.JsonWrapper(json_path: str)` # *class* `json_wrapper.JsonWrapper(json_path: str)`
### Methods ### Methods
* *def* `set(key: str, value, *, pathmagic: (str, list) = "")` * [*def* `set(key: str, value, *, pathmagic: (str, list) = "")`](https://github.com/RGBCube/json-wrapper/tree/main/docs#def-setkey-str-value--pathmagic-str-list--)
* *def* `get(key: str, *, default=None, pathmagic: (str, list) = "")` * [*def* `get(key: str, *, default=None, pathmagic: (str, list) = "")`]() TODO
* *def* `all()` * [*def* `all()`]() TODO
* *def* `rem(key: str, *, pathmagic: (str, list) = "")` * [*def* `rem(key: str, *, pathmagic: (str, list) = "")`]() TODO
* *def* `nuke(*, pathmagic: (str, list) = "")` * [*def* `nuke(*, pathmagic: (str, list) = "")`]() TODO
## *def* `set(key: str, value, *, pathmagic: (str, list) = "")` ## *def* `set(key: str, value, *, pathmagic: (str, list) = "")`
Sets the key value pair in the json.
If the pathmagic kwarg is given, (if str)it will split it by the +'s and make dicts inside dicts(or use existing ones) until the list ends. Then it will set the key value pair in the last dict.
#### Args:
* key `(str)`: The key for the key value pair.
* value `(Any)`: The value for the key value pair.
* pathmagic `(Union[str, List[str]], optional)`: The path to follow. Defaults to `""`.
#### [Example Usage]() TODO