Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
37 lines (23 loc) · 995 Bytes

File metadata and controls

37 lines (23 loc) · 995 Bytes
Copy raw file
Download raw file
Outline
Edit and raw actions

:mod:`ujson` -- JSON encoding and decoding

.. module:: ujson
   :synopsis: JSON encoding and decoding

|see_cpython_module| :mod:`cpython:json`.

This modules allows to convert between Python objects and the JSON data format.

Functions

.. function:: dump(obj, stream)

   Serialise ``obj`` to a JSON string, writing it to the given *stream*.

.. function:: dumps(obj)

   Return ``obj`` represented as a JSON string.

.. 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.

.. function:: loads(str)

   Parse the JSON *str* and return an object.  Raises :exc:`ValueError` if the
   string is not correctly formed.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.