2014-10-31 22:21:37 +00:00
|
|
|
:mod:`ujson` -- JSON encoding and decoding
|
|
|
|
==========================================
|
2014-10-31 01:37:19 +00:00
|
|
|
|
|
|
|
.. module:: ujson
|
|
|
|
:synopsis: JSON encoding and decoding
|
|
|
|
|
2017-07-02 13:37:31 +01:00
|
|
|
|see_cpython_module| :mod:`python:json`.
|
|
|
|
|
2014-10-31 01:37:19 +00:00
|
|
|
This modules allows to convert between Python objects and the JSON
|
|
|
|
data format.
|
|
|
|
|
|
|
|
Functions
|
|
|
|
---------
|
|
|
|
|
2018-02-06 04:48:24 +00:00
|
|
|
.. function:: dump(obj, stream)
|
|
|
|
|
|
|
|
Serialise *obj* to a JSON string, writing it to the given *stream*.
|
|
|
|
|
2014-10-31 01:37:19 +00:00
|
|
|
.. function:: dumps(obj)
|
|
|
|
|
2018-02-15 00:31:34 +00:00
|
|
|
Return *obj* represented as a JSON string.
|
2014-10-31 01:37:19 +00:00
|
|
|
|
2018-02-06 04:48:24 +00:00
|
|
|
.. function:: load(stream)
|
|
|
|
|
|
|
|
Parse the given *stream*, interpreting it as a JSON string and
|
|
|
|
deserialising the data to a Python object. The resulting object is
|
|
|
|
returned.
|
|
|
|
|
|
|
|
Parsing continues until end-of-file is encountered.
|
|
|
|
A :exc:`ValueError` is raised if the data in *stream* is not correctly formed.
|
|
|
|
|
2014-10-31 01:37:19 +00:00
|
|
|
.. function:: loads(str)
|
|
|
|
|
2018-02-15 00:31:34 +00:00
|
|
|
Parse the JSON *str* and return an object. Raises :exc:`ValueError` if the
|
2014-10-31 01:37:19 +00:00
|
|
|
string is not correctly formed.
|