mirror of
https://github.com/RGBCube/JsonWrapper
synced 2025-07-27 11:47:45 +00:00
rename
This commit is contained in:
parent
5b032c64a0
commit
3152c7e150
1 changed files with 18 additions and 18 deletions
36
README.md
36
README.md
|
@ -1,11 +1,11 @@
|
||||||
# 🈷️ ClutterDB
|
# 🈷️ JSONx
|
||||||
Extremely simple JSON database which behaves like a dict.
|
Easy JSON wrapper packed with features.
|
||||||
|
|
||||||
This was made for small discord bots, for big bots you should not use this database.
|
This was made for small discord bots, for big bots you should not use this database.
|
||||||
# 📥 Usage
|
# 📥 Usage
|
||||||
Clone [this](https://github.com/Clutter-Cluster/ClutterDB/blob/main/db.py) file into your project folder.
|
Clone [this](https://github.com/RGBCube/JSONx/blob/main/db.py) file into your project folder.
|
||||||
|
|
||||||
Add `from db import CluttterDB` to the top of your project.
|
Add `from db import JSONx` to the top of your project.
|
||||||
# 📄 Docs
|
# 📄 Docs
|
||||||
## `db.set(key: str, value, *, pathmagic="")`
|
## `db.set(key: str, value, *, pathmagic="")`
|
||||||
Sets the key to the value in the JSON.
|
Sets the key to the value in the JSON.
|
||||||
|
@ -31,9 +31,9 @@ Use with caution.
|
||||||
### Normal usage
|
### Normal usage
|
||||||
Code
|
Code
|
||||||
```python
|
```python
|
||||||
from db import ClutterDB
|
from db import JSONx
|
||||||
|
|
||||||
db = ClutterDB("db.json")
|
db = JSONx("db.json")
|
||||||
|
|
||||||
db.set("test", 123)
|
db.set("test", 123)
|
||||||
|
|
||||||
|
@ -48,9 +48,9 @@ Output
|
||||||
### Using with `pathmagic` kwarg
|
### Using with `pathmagic` kwarg
|
||||||
Code
|
Code
|
||||||
```python
|
```python
|
||||||
from db import ClutterDB
|
from db import JSONx
|
||||||
|
|
||||||
db = ClutterDB("db.json")
|
db = JSONx("db.json")
|
||||||
|
|
||||||
db.set("test", 123, pathmagic="a+b+c")
|
db.set("test", 123, pathmagic="a+b+c")
|
||||||
|
|
||||||
|
@ -66,9 +66,9 @@ Output
|
||||||
### Normal usage
|
### Normal usage
|
||||||
Code
|
Code
|
||||||
```python
|
```python
|
||||||
from db import ClutterDB
|
from db import JSONx
|
||||||
|
|
||||||
db = ClutterDB("db.json")
|
db = JSONx("db.json")
|
||||||
|
|
||||||
db.set("test", 123)
|
db.set("test", 123)
|
||||||
|
|
||||||
|
@ -83,9 +83,9 @@ Output
|
||||||
### Using without `default` kwarg
|
### Using without `default` kwarg
|
||||||
Code
|
Code
|
||||||
```python
|
```python
|
||||||
from db import ClutterDB
|
from db import JSONx
|
||||||
|
|
||||||
db = ClutterDB("db.json")
|
db = JSONx("db.json")
|
||||||
|
|
||||||
data = db.get("test")
|
data = db.get("test")
|
||||||
|
|
||||||
|
@ -98,9 +98,9 @@ None
|
||||||
### Using with `default` kwarg
|
### Using with `default` kwarg
|
||||||
Code
|
Code
|
||||||
```python
|
```python
|
||||||
from db import ClutterDB
|
from db import JSONx
|
||||||
|
|
||||||
db = ClutterDB("db.json")
|
db = JSONx("db.json")
|
||||||
|
|
||||||
data = db.get("test", default=123)
|
data = db.get("test", default=123)
|
||||||
|
|
||||||
|
@ -113,9 +113,9 @@ Output
|
||||||
### Using with `pathmagic` kwarg
|
### Using with `pathmagic` kwarg
|
||||||
Code
|
Code
|
||||||
```python
|
```python
|
||||||
from db import ClutterDB
|
from db import JSONx
|
||||||
|
|
||||||
db = ClutterDB("db.json")
|
db = JSONx("db.json")
|
||||||
|
|
||||||
db.set("test", 123, pathmagic="a+b+c")
|
db.set("test", 123, pathmagic="a+b+c")
|
||||||
|
|
||||||
|
@ -130,9 +130,9 @@ Output
|
||||||
## `db.rem()`
|
## `db.rem()`
|
||||||
Code
|
Code
|
||||||
```python
|
```python
|
||||||
from db import ClutterDB
|
from db import JSONx
|
||||||
|
|
||||||
db = ClutterDB("db.json")
|
db = JSONx("db.json")
|
||||||
|
|
||||||
db.set("test", 123)
|
db.set("test", 123)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue