simple json database lib
Project description
jsodb
Mine database realization that uses .json files.
How to work with it?
Instalation:
python3 -m pip install jsodb
Basic funcs:
import jdb
getkeyval("key") # returns key val
addkey(key=val) # adds keys to json
changekey("key", val) # changes key to new val
createjson("/path/to/file" """without .json""") # new .json file (without decorator)
addtokey("key", int) # key += int
subfromkey("key", int) # key -= int
addmultikey("key", key=val, key2=val2) # new multi key {key: {"key": "val", "key2", "val2"}}
@json("/path/to/file") # main decorator
To use all that functions you need function with decorator, json file will be: opened, edited, saved.
Basic usage:
@json("profile.json")
def func():
print(getkeyval(balance)) ### 1
changekey(balance, 10) ### {balance=10}
addkey(deposit=100) ### {balance=10, deposit=100}
print(f"{getkeyval(balance)}\n{getkeyval(deposit)}")
"""
10
100
"""
func() ### changes applied
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jsodb-1.6.0.tar.gz
(2.8 kB
view details)
Built Distribution
jsodb-1.6.0-py3-none-any.whl
(2.9 kB
view details)
File details
Details for the file jsodb-1.6.0.tar.gz
.
File metadata
- Download URL: jsodb-1.6.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5567c3f668faa8bd3be3f0f5b5fb001998928b530e74331476f7448a384aebe2 |
|
MD5 | b30b2d48c50d8bf1cdced328553945bc |
|
BLAKE2b-256 | 781d55b1ef78c7b9439c460bd6bc2f57c5290145f19ee9392d5b0bfb0383990c |
File details
Details for the file jsodb-1.6.0-py3-none-any.whl
.
File metadata
- Download URL: jsodb-1.6.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62860d69740e2071599218268a3f5b30d418b00e0c4a06020eddf1cbf00232a2 |
|
MD5 | 462d716148a305e5b34398a95077b7b4 |
|
BLAKE2b-256 | 908c0a6fb02a78245f14ad26f9ca893fe4c8e2e9c8fa06daf2fa4b55c6df9a11 |