Edge Python
Esc

Go to

Commands

Sign In

Sign in to publish packages and pin them by sha256.


By continuing, you accept our Terms and Conditions.

@
Palette

json

0.1.0

Encode and decode JSON with Python's hooks and options.

@dylan·0 downloads·103.6 KB·needs edge 0.7.3·Repository
edge add json && edge lock
bash

sha256-055de97b4078ea30b1df7093e373c69d56e9e00ca6c79af1599156d3b87721b3

Docs

json

json is loads and dumps. loads takes the object_hook, object_pairs_hook, parse_float, parse_int and parse_constant callables. dumps takes indent, sort_keys, ensure_ascii, check_circular, allow_nan, skipkeys, default, separators and cls.

ada
{"k": [1, 2, 3], "ok": true}
Output

indent and sort_keys shape the output.

{
  "a": [
    true,
    null
  ],
  "b": 1
}
Output

Integers cross as 128-bit values, so a round trip keeps numbers past 64 bits, and a float that holds a whole number keeps its .0 so it comes back a float.

True
3.0
3.0
Output

A parse failure raises json.JSONDecodeError, which is ValueError here, nesting past 1000 levels raises RuntimeError, and a value with no JSON form raises TypeError unless default turns it into one.

parse failed: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
dump failed: Object of type function is not JSON serializable
Output

Versions

VersionPublishedSize
0.1.0currentSeptember 28, 2026103.6 KB