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:
from jsodb 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.1.tar.gz
(2.5 kB
view details)
Built Distribution
jsodb-1.0.1-py3-none-any.whl
(2.7 kB
view details)
File details
Details for the file jsodb-1.0.1.tar.gz
.
File metadata
- Download URL: jsodb-1.0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c5d9175a92329e749f8100bda84310cc20e2dad178368cb67fe00c97a559dc6 |
|
MD5 | a990754ec2fb2bb626eea383b1b803bf |
|
BLAKE2b-256 | 93da28f2c7d843113756aca84f3b6f00aae4f1b596fd7be36c0ee17f9c12ed5c |
File details
Details for the file jsodb-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: jsodb-1.0.1-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c85c0f63738e298ff5d76823a8b280bb5aa030239292b6bb14df6c8046a58045 |
|
MD5 | d6f9fe4e21f4b70f478dfd09c7454a66 |
|
BLAKE2b-256 | 30f763b89f4b91ff1478dcc28698f14ce545307c824adea26727445809bc7298 |