Skip to content

Commit 4fbc739

Browse files
committed
Add details on how to use simplejson
1 parent fc0fa67 commit 4fbc739

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

docs/scenarios/json.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ and can now be used as a normal dictionary:
2626
print(parsed_json['first_name'])
2727
"Guido"
2828
29-
You can also convert a the following to JSON:
29+
You can also convert the following to JSON:
3030

3131
.. code-block:: python
3232
@@ -43,6 +43,14 @@ You can also convert a the following to JSON:
4343
simplejson
4444
----------
4545

46-
`simplejson <https://simplejson.readthedocs.org/en/latest/>`_ is the externally maintained development version of the json library.
46+
The JSON library was added to Python in version 2.6. If you're using an earlier version of Python, the `simplejson <https://simplejson.readthedocs.org/en/latest/>`_ library is available via PyPI.
4747

48-
simplejson mimics the json standard library, it is available so that developers that use an older version of python can use the latest features available in the json lib.
48+
simplejson mimics the json standard library. It is available so that developers that use older versions of Python can use the latest features available in the json lib.
49+
50+
You can start using simplejson when the json library is not available by importing simplejson under a different name:
51+
52+
.. code-block:: python
53+
54+
import simplejson as json
55+
56+
After importing simplejson as json, the above examples will all work as if you were using the standard json library.

0 commit comments

Comments
 (0)