Skip to main content

larzjson

Friendly JSON — human error messages, pretty-print, and plain-English structure.

The standard library parses JSON fine, but its errors ("Expecting ',' delimiter: line 3 column 9") stop beginners cold. larzjson wraps stdlib json to point at the exact spot with a caret, summarise a document's structure in plain English, and fetch nested values by a dotted path. A learning-and-debugging layer, zero third-party dependencies.

Install

pip install larzjson

Use

from larzjson import parse, pretty, validate, summarize, get

pretty('{"a":1,"b":[1,2]}')             # nicely indented
ok, msg = validate('{"a": 1,}')         # (False, message with a ^ under the ,)
summarize('{"name":"Ada","xs":[1,2]}')  # "An object with 2 keys: name (string); xs (list of 2)"
get({"user": {"scores": [90, 85]}}, "user.scores.0")   # 90

Learn to code with Larz

Part of the learn-to-code toolkit in the Larz stack — see the Learn to Code platform.

Tests

python -m unittest discover -s tests -v   # 10 tests

License

MIT (c) larz-scripter

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

larzjson-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

larzjson-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file larzjson-0.1.0.tar.gz.

File metadata

  • Download URL: larzjson-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for larzjson-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fc35131fd6002030b4b2d2f94285493643c05bc403d20215907cfd766d8bd258
MD5 31d24761afbf329a4b203f0074ece907
BLAKE2b-256 6221eaae44452192204a4c8581367665fae6a60899b6ce75361331f17c15501e

See more details on using hashes here.

File details

Details for the file larzjson-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: larzjson-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for larzjson-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55e44789261b820521cb0a9f30fc1fc412fce6544529f23588003e13b99e9fb4
MD5 37e16f5f6418f928deb86813ad319a0d
BLAKE2b-256 463581dae168b17b8215a838dd8cdba6a443a470b4e3bf3bd46e2fde65fe2c47

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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