Skip to main content

Introduction

This is a json parser. It understands everything within brackets. That means, you will give it anything like

{‘activePolygonId’:null,’polygons’:null,’route’:null}

Of course deeply nested arrays are fully supported without a limit.

d9t.json

>>> from d9t.json import parser

Let’s define some json data.

>>> json = """ {'data1':null, 'data2':'something', 'data3':[-1.42,2,-3,.34,-.55',string',true,{'datanested':'something','floatdata':44.22, 'bool':false}]} """
>>> domparser = parser.JsDomParser(json)
>>> data = domparser.parse()
>>> sorted(data.keys())
['data1', 'data2', 'data3']
>>> data["data1"] is None
True
>>> data["data2"]
'something'
>>> len(data['data3'])
8
>>> data['data3'][0] == -1.42
True
>>> data['data3'][1] == 2
True
>>> data['data3'][2] == -3
True
>>> data['data3'][3] == .34
True
>>> data['data3'][4] == -0.55
True
>>> data['data3'][5] == ',string'
True
>>> data['data3'][6] == True
True
>>> sorted(data['data3'][7].keys())
['bool', 'datanested', 'floatdata']
>>> data['data3'][7]['bool'] == False
True
>>> data['data3'][7]['floatdata'] == 44.22
True
>>> data['data3'][7]['datanested'] == 'something'
True

That’s it ;)

Changelog

0.4 - Bugfix release [20090622 - Daniel Kraft]

  • Negative Integers, negative Floats and floats with a “.”-start were not parsed correctly. Thanks Kevin Oberlies.

0.3* - splitted off from google.directions [Daniel Kraft]


  • Initial release

Metadata

Release files for d9t.json 0.4

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

Source distribution (sdist)

Source distribution for d9t.json 0.4
File Size Uploaded Provenance
d9t.json-0.4.tar.gz 17.9 kB Without provenance Details

Release files / d9t.json-0.4.tar.gz

Download URL d9t.json-0.4.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
37e21d648ff8b94ce13fa23a3eacf38be06a19b4b064bc72795000d237da7961
BLAKE2b-256 checksum
How to use checksums
d5d375a56a75853b2777b70ff456d3904488e1b9fcbb1088e793fba7268e8eec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for d9t.json 0.4

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.

Release history Release notifications | RSS feed

This release

0.4 This release

1 release file 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