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)
addtokey("key", int) # key += int
subfromkey("key", int) # key -= int
@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.5.5.tar.gz
(2.6 kB
view details)
Built Distribution
jsodb-1.5.5-py3-none-any.whl
(2.8 kB
view details)
File details
Details for the file jsodb-1.5.5.tar.gz
.
File metadata
- Download URL: jsodb-1.5.5.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 619d7d7682c1b62c3da884f6ffb965f7f89ca26461efc56cb70b541992271cae |
|
MD5 | 4f2da2e854abf92d1a74f7e1288d6f98 |
|
BLAKE2b-256 | 7461666dba8a7e86a3edcdfd02f1b33b716b15f7c7c0696f98bd1e10206c53b3 |
File details
Details for the file jsodb-1.5.5-py3-none-any.whl
.
File metadata
- Download URL: jsodb-1.5.5-py3-none-any.whl
- Upload date:
- Size: 2.8 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 | 3f62995f5f99e38d2d6ade78cc951e212b2141a6a15ccf318c0258b9f4246e5c |
|
MD5 | 09dc44965a20f2f7eb8082527cf171e9 |
|
BLAKE2b-256 | 6cca3477f9405bb20619bb7e216eae67c121ec64d9539fba5b76163d0b5aecca |