Metadata-Version: 2.4
Name: pyjson5
Version: 2.0.0
Summary: JSON5 serializer and parser for Python 3 written in Cython.
Home-page: https://github.com/Kijewski/pyjson5
Author: René Kijewski
Author-email: pypi.org@k6i.de
Maintainer: René Kijewski
Maintainer-email: pypi.org@k6i.de
Project-URL: Changelog, https://github.com/Kijewski/pyjson5/blob/main/CHANGELOG.md
Project-URL: Code, https://github.com/Kijewski/pyjson5
Project-URL: Documentation, https://pyjson5.readthedocs.io/
Project-URL: Download, https://pypi.org/project/pyjson5/
Project-URL: Homepage, https://github.com/Kijewski/pyjson5
Project-URL: Tracker, https://github.com/Kijewski/pyjson5/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Cython
Classifier: Programming Language :: JavaScript
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Text Processing :: General
Requires-Python: ~=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE.MIT
License-File: LICENSE.Apache
Dynamic: license-file

PyJSON5
==========

A JSON5 serializer and parser library for Python 3 written in
`Cython <http://cython.org/>`_.


Serializer
----------

The serializer returns ASCII data that can safely be used in an HTML template.
Apostrophes, ampersands, greater-than, and less-then signs are encoded as
unicode escaped sequences. E.g. this snippet is safe for any and all input:

.. code:: html

    "<a onclick='alert(" + encode(data) + ")'>show message</a>"

Unless the input contains infinite or NaN values, the result will be valid
`JSON <https://tools.ietf.org/html/rfc8259>`_ data.


Parser
------

All valid `JSON5 1.0.0 <https://spec.json5.org/>`_ and
`JSON <https://tools.ietf.org/html/rfc8259>`_ data can be read,
unless the nesting level is absurdly high.

Functions
---------

You can find the full documentation online at https://pyjson5.readthedocs.io/en/latest/.
Or simply call ``help(pyjson5)``. :-)

The library supplies load(s) and dump(s) functions, so you can use it as a
drop-in replacement for Python's builtin ``json`` module, but you *should*
use the functions ``encode_*()`` and ``decode_*()`` instead.

Compatibility
-------------

At least CPython 3.7 or a recent Pypy3 version is needed.
