This is a simple I/O JSON handler that allows direct operations on JSONs and with a single call to `JsonDB.flushAll`you can save them all on permanent memory.
Project description
JsonDB
This is a simple I/O JSON handler that allows direct operations on JSONs and with a single call to JsonDB.flushAll
you can save them all on permanent memory.
Example
from JsonDB import JsonDB
class Foo:
def __init__(self):
self.db = JsonDB("Foo.json", {"param1": [1,2,3,4], "param2": {"a": 1, "b": 2}})
self.params = self.db.getJSON()
def changeParam1(self, value):
self.params["param1"] = value
def changeParam2(self, value):
self.params["param2"] = value
foo = Foo()
foo.changeParam1([1,2,3])
foo.changeParam2(14)
# Save all JSON on respective files
JsonDB.flushAll()
Tests
Automated tests can be run with pytest-3 test.py
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
JsonDB-labm1997-0.0.3.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for JsonDB_labm1997-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e402790b9fff8a107d1581498f69e2f891f5f0c7640bf6f6fedad245bab2194f |
|
MD5 | 326f4300b8f5824b796a20fb562a48e2 |
|
BLAKE2b-256 | 5c25cf8238c42a144d39d5e293431f393dea357c2ce43761119ac7b846b1c203 |