Skip to content

Commit dad3d32

Browse files
authored
Update README
1 parent bdbc5e2 commit dad3d32

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,39 @@
11
# jsonbox-python
22
Python wrapper for https://jsonbox.io
3+
4+
## Installation
5+
pip install jsonbox
6+
7+
## Usage
8+
```python
9+
import uuid
10+
from jsonbox import JsonBox
11+
12+
# generate unique box id
13+
MY_BOX_ID = str(uuid.uuid4()).replace("-", "_")
14+
15+
# create instance
16+
jb = JsonBox()
17+
18+
data = {"name": "David"}
19+
20+
# write data
21+
result = jb.write(data, MY_BOX_ID)
22+
23+
# get record id of written data
24+
record_id = jb.get_record_id(result)
25+
26+
# read data
27+
print(jb.read(MY_BOX_ID, record_id))
28+
29+
# update data
30+
data = {"name": "Bob"}
31+
jb.update(data, MY_BOX_ID, record_id)
32+
33+
# read data
34+
print(jb.read(MY_BOX_ID, record_id))
35+
```
36+
37+
38+
## License
39+
MIT

0 commit comments

Comments
 (0)