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
Built Distribution
Close
Hashes for JsonDB-labm1997-0.0.3.post1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d3710c2909b56a8453b10fa9a436061f64241f57348f49f618ad901c383aa8b |
|
MD5 | af3d2793b6a828d253797f8ceb64f5c9 |
|
BLAKE2b-256 | 020b6a6c8fb4630b9ed49febc3bec96bd2828874965c41b7c5d2d8eb4265f5c2 |
Close
Hashes for JsonDB_labm1997-0.0.3.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 185e5e7d64e32bc3b4e82a4f3e2cb82bda8f79e91e96a293040ad9ec448708e9 |
|
MD5 | 582c5754985ec19a910399e9295f536b |
|
BLAKE2b-256 | 7d385dc1ef7e1787059d043e22496803a7960e2a6b2e91f8119877c39b3be6e9 |