Skip to main content

JsonNode Implementation

This drb-impl-json module implements json format access with DRB data model. It is able to navigates among the json contents.

Json Factory and Json Node

The module implements the basic factory model defined in DRB in its node resolver. Based on the python entry point mechanism, this module can be dynamically imported into applications.

The entry point group reference is drb.impl.
The implementation name is json.
The factory class is encoded into drb_impl_json.json_node_factory.

The json factory creates a JsonNode from an existing json content. It uses a base node to access the content data using the streamed base node implementation.

The base node can be a FileNode (See drb-impl-file), HttpNode, ZipNode or any other node able to provide streamed (BufferedIOBase, RawIOBase, IO) json content.

limitations

The current version does not manage child modification and insertion. JsonNode is currently read only.

Using this module

To include this module into your project, the drb-impl-json module shall be referenced into requirement.txt file, or the following pip line can be run:

pip install drb-impl-json

Node Creation:

The implementation can create a JsonNode by giving the path to a json file:

from drb_impl_json import DrbJsonNode

node = JsonNode(PATH_JSON)

the implementation can also give a dictionary in argument:

from drb_impl_json import DrbJsonNode

DICT = { 
        "id":"01", 
        "name": "Tom", 
        "lastname": "Price" 
     }
node = JsonNode(NAME_OF_YOUR_NODE, data = DICT)

If the baseNode is an HttpNode, FileNode... the implementation can retrieve the data of your Json with this:

from drb_impl_json import JsonNodeFactory

FACTORY = JsonNodeFactory()
FILE_NODE = DrbFileNode(PATH_TO_YOUR_JSON)
NODE = FACTORY.create(FILE_NODE)

Different types of data

data JSON Type Python Type
null null None
true/false boolean bool
'hello World' string str
1 int int
1.0 number float
[...] array list
{...} object dict

Documentation

The documentation of this implementation can be found here https://drb-python.gitlab.io/impl/json

Metadata

Release files for drb-impl-json 1.0.1

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

Source distribution (sdist)

Source distribution for drb-impl-json 1.0.1
File Size Uploaded
drb-impl-json-1.0.1.tar.gz 22.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for drb-impl-json 1.0.1
File Interpreter ABI Platform
drb_impl_json-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.3 kB

Release files / drb-impl-json-1.0.1.tar.gz

Download URL drb-impl-json-1.0.1.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1eed98ce0a60f2dc4954cc0be14426c0d8f8b8369c938b24769574f266cefcdc
BLAKE2b-256 checksum
How to use checksums
62f45a395d0847ff9710a83adfe529a25913813d34cb5eeb967d0fd3820880bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.8.13

Release files / drb_impl_json-1.0.1-py3-none-any.whl

Download URL drb_impl_json-1.0.1-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7de9cfe9ba106c71c4c96e4346d057f7489101fa3bca043e6df013f2359049bb
BLAKE2b-256 checksum
How to use checksums
ea5d583734a0494a6dc4e1bfc881478ab7ff5ea9777b8107c86b3689e13c39ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.8.13

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

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