Skip to main content

Read Write JSON

Load JSON Settings from file

Write JSON Settings to file

- Read settings file from json format and return it
- Write settings file from json format
- Interactive write in json settings with save option
- Write out json file if file is missing
    - values
        - string, int, float
        - [list], {"dict":"value"}
pip install jsonreadwrite

Todo: Write proper documentation

from jsonreadwrite import JsonReadWrite

testlist = ["test1", "test2", "test3"]
testdict = {"test1": "test1", "test2": "test2", "test3": "test3"}
testint = 1
testfloat = 1.1
testbool = True
testnone = None
testblank = ""

test = JsonReadWrite("test.json",allowempty=True)

test.set("testlist", testlist)
test.set("testdict", testdict)
test.set("testint", testint)
test.set("testfloat", testfloat)
test.set("testbool", testbool)
test.set("testnone", testnone)
test.set("testblank", testblank)

assert test.get("testlist") == testlist
assert test.get("testdict") == testdict
assert test.get("testint") == testint
assert test.get("testfloat") == testfloat
assert test.get("testbool") == testbool
assert test.get("testnone") == testnone
assert test.get("testblank") == testblank
{
      "testlist": [
            "test1",
            "test2",
            "test3"
      ],
      "testdict": {
            "test1": "test1",
            "test2": "test2",
            "test3": "test3"
      },
      "testint": 1,
      "testfloat": 1.1,
      "testbool": true,
      "testnone": null,
      "testblank": ""
}

Metadata

Release files for jsonreadwrite 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jsonreadwrite 1.0.0
File Size Uploaded Provenance Actions
jsonreadwrite-1.0.0.tar.gz 3.5 kB Without provenance Details for jsonreadwrite-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jsonreadwrite 1.0.0
File Interpreter ABI Platform Actions
jsonreadwrite-1.0.0-py3-none-any.whl Python 3 none any Details for jsonreadwrite-1.0.0-py3-none-any.whl

Total release size: 7.4 kB

Release files / jsonreadwrite-1.0.0.tar.gz

Download URL jsonreadwrite-1.0.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b11c4bbdbcd13c96f009d983c2b1c44f014069a3439e9bee8f00b41a42ae291f
BLAKE2b-256 checksum
How to use checksums
201c95101fad6c9885aa15b0ff2d7880bc53bf09937e84ed274a89125136d0cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.13

Release files / jsonreadwrite-1.0.0-py3-none-any.whl

Download URL jsonreadwrite-1.0.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c6efc41e60480c3b52233150bb652e46513707ca875b3336dade15cc75344af
BLAKE2b-256 checksum
How to use checksums
808f6403637820a93125cc68fec67490f8dae264b0a31214cb7fb0bf0dec2e3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.13

Security for jsonreadwrite 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page