From 3bbb64d3de160319af2e7a5517e38290c172ef4e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 20 Sep 2021 13:30:37 +0300 Subject: [PATCH 1/2] Replace README.rst with .md --- README.md | 126 ++++++++++++++++++++++++++++++++ README.rst | 176 --------------------------------------------- setup.cfg | 4 +- tests/benchmark.py | 23 +++--- 4 files changed, 139 insertions(+), 190 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/README.md b/README.md new file mode 100644 index 00000000..4e02b796 --- /dev/null +++ b/README.md @@ -0,0 +1,126 @@ +# UltraJSON + +[![PyPI version](https://img.shields.io/pypi/v/ujson.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/ujson) +[![Supported Python versions](https://img.shields.io/pypi/pyversions/ujson.svg?logo=python&logoColor=FFE873)](https://pypi.org/project/ujson) +[![PyPI downloads](https://img.shields.io/pypi/dm/ujson.svg)](https://pypistats.org/packages/ujson) +[![GitHub Actions status](https://github.com/ultrajson/ultrajson/workflows/Test/badge.svg)](https://github.com/ultrajson/ultrajson/actions) +[![Travis CI status](https://travis-ci.com/ultrajson/ultrajson.svg?branch=main)](https://travis-ci.com/ultrajson/ultrajson) +[![codecov](https://codecov.io/gh/ultrajson/ultrajson/branch/main/graph/badge.svg)](https://codecov.io/gh/ultrajson/ultrajson) +[![DOI](https://zenodo.org/badge/1418941.svg)](https://zenodo.org/badge/latestdoi/1418941) +[![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black) + +UltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for +Python 3.6+. + +Install with pip: + +```sh +python -m pip install ujson +``` + +## Usage + +May be used as a drop in replacement for most other JSON parsers for Python: + +```pycon +>>> import ujson +>>> ujson.dumps([{"key": "value"}, 81, True]) +'[{"key":"value"},81,true]' +>>> ujson.loads("""[{"key": "value"}, 81, true]""") +[{'key': 'value'}, 81, True] +``` + +### Encoder options + +#### encode_html_chars + +Used to enable special encoding of "unsafe" HTML characters into safer Unicode +sequences. Default is `False`: + +```pycon +>>> ujson.dumps("