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.5.0.tar.gz
(2.6 kB
view details)
Built Distribution
jsodb-1.5.0-py3-none-any.whl
(2.7 kB
view details)
File details
Details for the file jsodb-1.5.0.tar.gz
.
File metadata
- Download URL: jsodb-1.5.0.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 | b9b3cc44896809967a37b42bf49fa2aef3ba62a87e8cb8cafe5dcd03de12dab4 |
|
MD5 | dcf85e616a49388b6eaca3006f3ceb61 |
|
BLAKE2b-256 | 009c38f02b70fb40e08b26a505dbad2a7486894c40429663bb042bc62ff261d5 |
File details
Details for the file jsodb-1.5.0-py3-none-any.whl
.
File metadata
- Download URL: jsodb-1.5.0-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.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d158a5354312f0cd7ac20115fc27d7418789ec2cc499212e7e1430adc195f4ec |
|
MD5 | f32b1e272ce33999455ad4f58b9f7f10 |
|
BLAKE2b-256 | 390ef8cc7c16afbec859e6221c83e83fff77572c781c527dea8157f09c422594 |