Lines Matching refs:JSON
1 :mod:`json` --- JSON encoder and decoder
5 :synopsis: Encode and decode the JSON format.
14 `JSON (JavaScript Object Notation) <https://json.org>`_, specified by
22 Be cautious when parsing JSON data from untrusted sources. A malicious
23 JSON string may cause the decoder to consume considerable CPU and memory
63 Decoding JSON::
75 Specializing JSON object decoding::
123 JSON is a subset of `YAML <http://yaml.org/>`_ 1.2. The JSON produced by
138 JSON generation and parsing.
149 Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting
171 ``inf``, ``-inf``) in strict compliance of the JSON specification.
175 If *indent* is a non-negative integer or string, then JSON array elements and
187 ``(',', ': ')`` otherwise. To get the most compact JSON representation,
194 can't otherwise be serialized. It should return a JSON encodable version of
210 Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol,
212 :func:`dump` using the same *fp* will result in an invalid JSON file.
219 Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion
225 Keys in key/value pairs of JSON are always of the type :class:`str`. When
226 a dictionary is converted into JSON, all the keys of the dictionary are
228 into JSON and then back into a dictionary, the dictionary may not equal
235 :term:`binary file` containing a JSON document) to a Python object using
241 to implement custom decoders (e.g. `JSON-RPC <http://www.jsonrpc.org>`_
253 *parse_float*, if specified, will be called with the string of every JSON
255 This can be used to use another datatype or parser for JSON floats
258 *parse_int*, if specified, will be called with the string of every JSON int
260 be used to use another datatype or parser for JSON integers
271 This can be used to raise an exception if invalid JSON numbers
281 If the data being deserialized is not a valid JSON document, a
294 instance containing a JSON document) to a Python object using this
299 If the data being deserialized is not a valid JSON document, a
315 Simple JSON decoder.
322 | JSON | Python |
342 corresponding ``float`` values, which is outside the JSON spec.
344 *object_hook*, if specified, will be called with the result of every JSON
347 support `JSON-RPC <http://www.jsonrpc.org>`_ class hinting).
350 JSON object decoded with an ordered list of pairs. The return value of
358 *parse_float*, if specified, will be called with the string of every JSON
360 This can be used to use another datatype or parser for JSON floats
363 *parse_int*, if specified, will be called with the string of every JSON int
365 be used to use another datatype or parser for JSON integers
370 This can be used to raise an exception if invalid JSON numbers
378 If the data being deserialized is not a valid JSON document, a
387 containing a JSON document).
389 :exc:`JSONDecodeError` will be raised if the given JSON document is not
394 Decode a JSON document from *s* (a :class:`str` beginning with a
395 JSON document) and return a 2-tuple of the Python representation
398 This can be used to decode a JSON document from a string that may have
404 Extensible JSON encoder for Python data structures.
411 | Python | JSON |
450 ``-Infinity`` will be encoded as such. This behavior is not JSON
457 JSON serializations can be compared on a day-to-day basis.
459 If *indent* is a non-negative integer or string, then JSON array elements and
471 ``(',', ': ')`` otherwise. To get the most compact JSON representation,
478 can't otherwise be serialized. It should return a JSON encodable version of
508 Return a JSON string representation of a Python data structure, *o*. For
537 The JSON document being parsed.
557 The JSON format is specified by :rfc:`7159` and by
564 extensions that are valid JavaScript but not valid JSON. In particular:
577 The RFC requires that JSON be represented using either UTF-8, UTF-16, or
589 The RFC prohibits adding a byte order mark (BOM) to the start of a JSON text,
591 The RFC permits, but does not require, JSON deserializers to ignore an initial
595 The RFC does not explicitly forbid JSON strings which contain byte sequences
607 ``-Infinity``, and ``NaN`` as if they were valid JSON number literal values::
609 >>> # Neither of these calls raises an exception, but the results are not valid JSON
628 The RFC specifies that the names within a JSON object should be unique, but
629 does not mandate how repeated names in JSON objects should be handled. By
643 The old version of JSON specified by the obsolete :rfc:`4627` required that
644 the top-level value of a JSON text must be either a JSON object or array
645 (Python :class:`dict` or :class:`list`), and could not be a JSON null,
657 Some JSON deserializer implementations may set limits on:
659 * the size of accepted JSON texts
660 * the maximum level of nesting of JSON objects and arrays
661 * the range and precision of JSON numbers
662 * the content and maximum length of JSON strings
667 When serializing to JSON, beware any such limitations in applications that may
668 consume your JSON. In particular, it is common for JSON numbers to be
683 :synopsis: A command line to validate and pretty-print JSON.
690 and pretty-print JSON objects.
715 The JSON file to be validated or pretty-printed:
752 Parse every input line as separate JSON object.
771 JSON permits literal U+2028 (LINE SEPARATOR) and