-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
123 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,46 @@ | ||
LightDB | ||
======= | ||
<h1>LightDB</h1> | ||
|
||
|
||
What is this? | ||
------------- | ||
<h2>What is this?</h2> | ||
|
||
LightDB is a lightweight JSON Database for Python | ||
that allows you to **quickly** and **easily** write data to a file | ||
that allows you to <b>quickly</b> and <b>easily</b> write data to a file | ||
|
||
|
||
Installing | ||
---------- | ||
```Shell | ||
<h2>Installing</h2> | ||
|
||
<pre lang="bash"> | ||
pip3 install lightdb | ||
``` | ||
</pre> | ||
|
||
|
||
<h2>How to use</h2> | ||
|
||
How to use | ||
---------- | ||
```Python | ||
<pre lang="python"> | ||
from lightdb import LightDB | ||
|
||
db = LightDB("/path/to/file.json") # or a non-existent file, it will be created automatically | ||
|
||
# `SET` method: | ||
# SET method: | ||
|
||
data = { | ||
"key1": "value1", | ||
"key2": ["value2", "value3", ...], | ||
"key2": [ | ||
"value2", | ||
"value3", | ||
... | ||
], | ||
... | ||
} | ||
db.set("key3", data) | ||
data = ["value4", "value5"] | ||
db.set("key4", data) | ||
|
||
|
||
# or `GET`: | ||
# or GET: | ||
|
||
print(db.get("key3")) | ||
# {"key1": "value1", "key2": ["value2", "value3", ...]} | ||
# {"key1": "value1", "key2": ["value2", "value3"]} | ||
print(db.get("key4")) | ||
# ["value4", "value5"] | ||
``` | ||
</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
""" | ||
See LightDB docstring: | ||
"""See LightDB docstring: | ||
from LightDB import LightDB | ||
--------------------- | ||
:copyright: (c) 2021 by Fl1yd. | ||
:copyright: (c) 2021-2022 by Fl1yd. | ||
:license: MIT, see LICENSE for more details. | ||
""" | ||
|
||
from .LightDB import LightDB | ||
|
||
__version__ = "1.1" | ||
__version__ = "1.2" |