Skip to main content

A Python package to inpsect/manage json objects.

Project description

json_navigator

Usage

If the object you want to inspect is a Python list, use the method below

from navJson import jsonParsing
jsonToBeParsed = [ {"A":2}, {"B":3} ]

returnedCollectionOfCodes, _ = jsonParsing.listParserAndCodeCreator( jsonToBeParsed, rootCode = "jsonToBeParsed", collectionOfCodes = list() )

resultList = [  (code , eval(code) ) for code in returnedCollectionOfCodes   ]
Output:

(jsonToBeParsed[0]["A"], 2), (jsonToBeParsed[0]["B"], 3)

If it is a python dictionary, use below method

from navJson import jsonParsing
jsonToBeParsed = {"A":2, "B":[3,4]}

returnedCollectionOfCodes, _ = jsonParsing.jsonParserAndCodeCreator( jsonToBeParsed, rootCode = "jsonToBeParsed", collectionOfCodes = list() )

resultList = [  (code , eval(code) ) for code in returnedCollectionOfCodes   ]
Output:

(jsonToBeParsed["A"], 2), (jsonToBeParsed["B"][0], 3), (jsonToBeParsed["B"][1], 4 )

Try it out with more complicated json structures!

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

navigate-json-1.0.8.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

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

navigate_json-1.0.8-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

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