Skip to main content

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.flushAllyou 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


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.post1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

JsonDB_labm1997-0.0.3.post1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file JsonDB-labm1997-0.0.3.post1.tar.gz.

File metadata

  • Download URL: JsonDB-labm1997-0.0.3.post1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for JsonDB-labm1997-0.0.3.post1.tar.gz
Algorithm Hash digest
SHA256 3d3710c2909b56a8453b10fa9a436061f64241f57348f49f618ad901c383aa8b
MD5 af3d2793b6a828d253797f8ceb64f5c9
BLAKE2b-256 020b6a6c8fb4630b9ed49febc3bec96bd2828874965c41b7c5d2d8eb4265f5c2

See more details on using hashes here.

File details

Details for the file JsonDB_labm1997-0.0.3.post1-py3-none-any.whl.

File metadata

  • Download URL: JsonDB_labm1997-0.0.3.post1-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for JsonDB_labm1997-0.0.3.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 185e5e7d64e32bc3b4e82a4f3e2cb82bda8f79e91e96a293040ad9ec448708e9
MD5 582c5754985ec19a910399e9295f536b
BLAKE2b-256 7d385dc1ef7e1787059d043e22496803a7960e2a6b2e91f8119877c39b3be6e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page