• Home
  • Raw
  • Download

Lines Matching refs:JSON

1 :mod:`json` --- JSON encoder and decoder
5 :synopsis: Encode and decode the JSON format.
14 `JSON (JavaScript Object Notation) <http://json.org>`_, specified by
58 Decoding JSON::
70 Specializing JSON object decoding::
118 JSON is a subset of `YAML <http://yaml.org/>`_ 1.2. The JSON produced by
132 Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting
154 ``inf``, ``-inf``) in strict compliance of the JSON specification.
158 If *indent* is a non-negative integer or string, then JSON array elements and
170 ``(',', ': ')`` otherwise. To get the most compact JSON representation,
177 can't otherwise be serialized. It should return a JSON encodable version of
193 Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol,
195 :func:`dump` using the same *fp* will result in an invalid JSON file.
202 Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion
208 Keys in key/value pairs of JSON are always of the type :class:`str`. When
209 a dictionary is converted into JSON, all the keys of the dictionary are
211 into JSON and then back into a dictionary, the dictionary may not equal
218 :term:`binary file` containing a JSON document) to a Python object using
224 to implement custom decoders (e.g. `JSON-RPC <http://www.jsonrpc.org>`_
236 *parse_float*, if specified, will be called with the string of every JSON
238 This can be used to use another datatype or parser for JSON floats
241 *parse_int*, if specified, will be called with the string of every JSON int
243 be used to use another datatype or parser for JSON integers
248 This can be used to raise an exception if invalid JSON numbers
258 If the data being deserialized is not a valid JSON document, a
271 instance containing a JSON document) to a Python object using this
277 If the data being deserialized is not a valid JSON document, a
290 Simple JSON decoder.
297 | JSON | Python |
317 corresponding ``float`` values, which is outside the JSON spec.
319 *object_hook*, if specified, will be called with the result of every JSON
322 support JSON-RPC class hinting).
325 JSON object decoded with an ordered list of pairs. The return value of
333 *parse_float*, if specified, will be called with the string of every JSON
335 This can be used to use another datatype or parser for JSON floats
338 *parse_int*, if specified, will be called with the string of every JSON int
340 be used to use another datatype or parser for JSON integers
345 This can be used to raise an exception if invalid JSON numbers
353 If the data being deserialized is not a valid JSON document, a
362 containing a JSON document).
364 :exc:`JSONDecodeError` will be raised if the given JSON document is not
369 Decode a JSON document from *s* (a :class:`str` beginning with a
370 JSON document) and return a 2-tuple of the Python representation
373 This can be used to decode a JSON document from a string that may have
379 Extensible JSON encoder for Python data structures.
386 | Python | JSON |
426 ``-Infinity`` will be encoded as such. This behavior is not JSON
433 JSON serializations can be compared on a day-to-day basis.
435 If *indent* is a non-negative integer or string, then JSON array elements and
447 ``(',', ': ')`` otherwise. To get the most compact JSON representation,
454 can't otherwise be serialized. It should return a JSON encodable version of
484 Return a JSON string representation of a Python data structure, *o*. For
513 The JSON document being parsed.
533 The JSON format is specified by :rfc:`7159` and by
540 extensions that are valid JavaScript but not valid JSON. In particular:
553 The RFC requires that JSON be represented using either UTF-8, UTF-16, or
565 The RFC prohibits adding a byte order mark (BOM) to the start of a JSON text,
567 The RFC permits, but does not require, JSON deserializers to ignore an initial
571 The RFC does not explicitly forbid JSON strings which contain byte sequences
583 ``-Infinity``, and ``NaN`` as if they were valid JSON number literal values::
585 >>> # Neither of these calls raises an exception, but the results are not valid JSON
604 The RFC specifies that the names within a JSON object should be unique, but
605 does not mandate how repeated names in JSON objects should be handled. By
619 The old version of JSON specified by the obsolete :rfc:`4627` required that
620 the top-level value of a JSON text must be either a JSON object or array
621 (Python :class:`dict` or :class:`list`), and could not be a JSON null,
633 Some JSON deserializer implementations may set limits on:
635 * the size of accepted JSON texts
636 * the maximum level of nesting of JSON objects and arrays
637 * the range and precision of JSON numbers
638 * the content and maximum length of JSON strings
643 When serializing to JSON, beware any such limitations in applications that may
644 consume your JSON. In particular, it is common for JSON numbers to be
659 :synopsis: A command line to validate and pretty-print JSON.
666 and pretty-print JSON objects.
691 The JSON file to be validated or pretty-printed:
729 JSON permits literal U+2028 (LINE SEPARATOR) and