Lines Matching refs:JSON
1 :mod:`json` --- JSON encoder and decoder
5 :synopsis: Encode and decode the JSON format.
10 `JSON (JavaScript Object Notation) <http://json.org>`_, specified by
55 Decoding JSON::
67 Specializing JSON object decoding::
115 JSON is a subset of `YAML <http://yaml.org/>`_ 1.2. The JSON produced by
129 Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting
153 ``inf``, ``-inf``) in strict compliance of the JSON specification.
157 If *indent* is a non-negative integer, then JSON array elements and object
169 tuple. By default, ``(', ', ': ')`` are used. To get the most compact JSON
175 can't otherwise be serialized. It should return a JSON encodable version of
188 Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol so
190 the same *fp* will result in an invalid JSON file.
197 Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion
206 Keys in key/value pairs of JSON are always of the type :class:`str`. When
207 a dictionary is converted into JSON, all the keys of the dictionary are
209 into JSON and then back into a dictionary, the dictionary may not equal
216 containing a JSON document) to a Python object using this :ref:`conversion
228 to implement custom decoders (e.g. `JSON-RPC <http://www.jsonrpc.org>`_
242 *parse_float*, if specified, will be called with the string of every JSON
244 This can be used to use another datatype or parser for JSON floats
247 *parse_int*, if specified, will be called with the string of every JSON int
249 be used to use another datatype or parser for JSON integers
254 This can be used to raise an exception if invalid JSON numbers
267 Deserialize *s* (a :class:`str` or :class:`unicode` instance containing a JSON
284 Simple JSON decoder.
291 | JSON | Python |
311 corresponding ``float`` values, which is outside the JSON spec.
320 *object_hook*, if specified, will be called with the result of every JSON
323 support JSON-RPC class hinting).
326 JSON object decoded with an ordered list of pairs. The return value of
336 *parse_float*, if specified, will be called with the string of every JSON
338 This can be used to use another datatype or parser for JSON floats
341 *parse_int*, if specified, will be called with the string of every JSON int
343 be used to use another datatype or parser for JSON integers
348 This can be used to raise an exception if invalid JSON numbers
356 If the data being deserialized is not a valid JSON document, a
362 :class:`unicode` instance containing a JSON document).
366 Decode a JSON document from *s* (a :class:`str` or :class:`unicode`
367 beginning with a JSON document) and return a 2-tuple of the Python
370 This can be used to decode a JSON document from a string that may have
376 Extensible JSON encoder for Python data structures.
383 | Python | JSON |
422 ``-Infinity`` will be encoded as such. This behavior is not JSON
429 JSON serializations can be compared on a day-to-day basis.
431 If *indent* is a non-negative integer (it is ``None`` by default), then JSON
443 tuple. By default, ``(', ', ': ')`` are used. To get the most compact JSON
447 can't otherwise be serialized. It should return a JSON encodable version of
452 into unicode using that encoding prior to JSON-encoding. The default is
478 Return a JSON string representation of a Python data structure, *o*. For
497 The JSON format is specified by :rfc:`7159` and by
504 extensions that are valid JavaScript but not valid JSON. In particular:
517 The RFC requires that JSON be represented using either UTF-8, UTF-16, or
530 The RFC prohibits adding a byte order mark (BOM) to the start of a JSON text,
532 The RFC permits, but does not require, JSON deserializers to ignore an initial
536 The RFC does not explicitly forbid JSON strings which contain byte sequences
548 ``-Infinity``, and ``NaN`` as if they were valid JSON number literal values::
550 >>> # Neither of these calls raises an exception, but the results are not valid JSON
569 The RFC specifies that the names within a JSON object should be unique, but
570 does not mandate how repeated names in JSON objects should be handled. By
584 The old version of JSON specified by the obsolete :rfc:`4627` required that
585 the top-level value of a JSON text must be either a JSON object or array
586 (Python :class:`dict` or :class:`list`), and could not be a JSON null,
598 Some JSON deserializer implementations may set limits on:
600 * the size of accepted JSON texts
601 * the maximum level of nesting of JSON objects and arrays
602 * the range and precision of JSON numbers
603 * the content and maximum length of JSON strings
608 When serializing to JSON, beware any such limitations in applications that may
609 consume your JSON. In particular, it is common for JSON numbers to be
621 JSON permits literal U+2028 (LINE SEPARATOR) and