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") # new .json file (without decorator)
@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.0.0.tar.gz
(2.5 kB
view hashes)
Built Distribution
jsodb-1.0.0-py3-none-any.whl
(2.7 kB
view hashes)