{"id":13439960,"url":"https://github.com/ultrajson/ultrajson","last_synced_at":"2025-05-12T05:30:16.579Z","repository":{"id":37022928,"uuid":"1418941","full_name":"ultrajson/ultrajson","owner":"ultrajson","description":"Ultra fast JSON decoder and encoder written in C with Python bindings","archived":false,"fork":false,"pushed_at":"2025-05-11T05:46:42.000Z","size":8650,"stargazers_count":4401,"open_issues_count":28,"forks_count":370,"subscribers_count":87,"default_branch":"main","last_synced_at":"2025-05-12T02:44:55.552Z","etag":null,"topics":["c","decoder","encoder","json","python","ujson","ultrajson"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/ujson/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ultrajson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-02-27T20:00:51.000Z","updated_at":"2025-05-12T02:14:37.000Z","dependencies_parsed_at":"2024-01-08T18:21:20.888Z","dependency_job_id":"b915bd81-2534-440b-a7ec-e86d167dc3ab","html_url":"https://github.com/ultrajson/ultrajson","commit_stats":null,"previous_names":["esnme/ultrajson"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultrajson%2Fultrajson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultrajson%2Fultrajson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultrajson%2Fultrajson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ultrajson%2Fultrajson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ultrajson","download_url":"https://codeload.github.com/ultrajson/ultrajson/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672731,"owners_count":21945482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","decoder","encoder","json","python","ujson","ultrajson"],"created_at":"2024-07-31T03:01:18.525Z","updated_at":"2025-05-12T05:30:16.485Z","avatar_url":"https://github.com/ultrajson.png","language":"C","readme":"# UltraJSON\n\n[![PyPI version](https://img.shields.io/pypi/v/ujson.svg?logo=pypi\u0026logoColor=FFE873)](https://pypi.org/project/ujson)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/ujson.svg?logo=python\u0026logoColor=FFE873)](https://pypi.org/project/ujson)\n[![PyPI downloads](https://img.shields.io/pypi/dm/ujson.svg)](https://pypistats.org/packages/ujson)\n[![GitHub Actions status](https://github.com/ultrajson/ultrajson/workflows/Test/badge.svg)](https://github.com/ultrajson/ultrajson/actions)\n[![codecov](https://codecov.io/gh/ultrajson/ultrajson/branch/main/graph/badge.svg)](https://codecov.io/gh/ultrajson/ultrajson)\n[![DOI](https://zenodo.org/badge/1418941.svg)](https://zenodo.org/badge/latestdoi/1418941)\n[![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black)\n\nUltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for\nPython 3.9+.\n\nInstall with pip:\n\n```sh\npython -m pip install ujson\n```\n\n## Project status\n\n\u003e [!WARNING]\n\u003e UltraJSON's architecture is fundamentally ill-suited to making changes without\n\u003e risk of introducing new security vulnerabilities. As a result, this library\n\u003e has been put into a *maintenance-only* mode. Support for new Python versions\n\u003e will be added and critical bugs and security issues will still be\n\u003e fixed but all other changes will be rejected. Users are encouraged to migrate\n\u003e to [orjson](https://pypi.org/project/orjson/) which is both much faster and\n\u003e less likely to introduce a surprise buffer overflow vulnerability in the\n\u003e future.\n\n## Usage\n\nMay be used as a drop in replacement for most other JSON parsers for Python:\n\n```pycon\n\u003e\u003e\u003e import ujson\n\u003e\u003e\u003e ujson.dumps([{\"key\": \"value\"}, 81, True])\n'[{\"key\":\"value\"},81,true]'\n\u003e\u003e\u003e ujson.loads(\"\"\"[{\"key\": \"value\"}, 81, true]\"\"\")\n[{'key': 'value'}, 81, True]\n```\n\n### Encoder options\n\n#### encode_html_chars\n\nUsed to enable special encoding of \"unsafe\" HTML characters into safer Unicode\nsequences. Default is `False`:\n\n```pycon\n\u003e\u003e\u003e ujson.dumps(\"\u003cscript\u003eJohn\u0026Doe\", encode_html_chars=True)\n'\"\\\\u003cscript\\\\u003eJohn\\\\u0026Doe\"'\n```\n\n#### ensure_ascii\n\nLimits output to ASCII and escapes all extended characters above 127. Default is `True`.\nIf your end format supports UTF-8, setting this option to false is highly recommended to\nsave space:\n\n```pycon\n\u003e\u003e\u003e ujson.dumps(\"åäö\")\n'\"\\\\u00e5\\\\u00e4\\\\u00f6\"'\n\u003e\u003e\u003e ujson.dumps(\"åäö\", ensure_ascii=False)\n'\"åäö\"'\n```\n\n#### escape_forward_slashes\n\nControls whether forward slashes (`/`) are escaped. Default is `True`:\n\n```pycon\n\u003e\u003e\u003e ujson.dumps(\"https://example.com\")\n'\"https:\\\\/\\\\/example.com\"'\n\u003e\u003e\u003e ujson.dumps(\"https://example.com\", escape_forward_slashes=False)\n'\"https://example.com\"'\n```\n\n#### indent\n\nControls whether indentation (\"pretty output\") is enabled. Default is `0` (disabled):\n\n```pycon\n\u003e\u003e\u003e ujson.dumps({\"foo\": \"bar\"})\n'{\"foo\":\"bar\"}'\n\u003e\u003e\u003e print(ujson.dumps({\"foo\": \"bar\"}, indent=4))\n{\n    \"foo\": \"bar\"\n}\n```\n\n## Benchmarks\n\n*UltraJSON* calls/sec compared to other popular JSON parsers with performance gain\nspecified below each.\n\n### Test machine\n\nLinux 5.15.0-1037-azure x86_64 #44-Ubuntu SMP Thu Apr 20 13:19:31 UTC 2023\n\n### Versions\n\n- CPython 3.11.3 (main, Apr  6 2023, 07:55:46) [GCC 11.3.0]\n- ujson        : 5.7.1.dev26\n- orjson       : 3.9.0\n- simplejson   : 3.19.1\n- json         : 2.0.9\n\n|                                                                               | ujson      | orjson     | simplejson | json       |\n|-------------------------------------------------------------------------------|-----------:|-----------:|-----------:|-----------:|\n| Array with 256 doubles                                                        |            |            |            |            |\n| encode                                                                        |     18,282 |     79,569 |      5,681 |      5,935 |\n| decode                                                                        |     28,765 |     93,283 |     13,844 |     13,367 |\n| Array with 256 UTF-8 strings                                                  |            |            |            |            |\n| encode                                                                        |      3,457 |     26,437 |      3,630 |      3,653 |\n| decode                                                                        |      3,576 |      4,236 |        522 |      1,978 |\n| Array with 256 strings                                                        |            |            |            |            |\n| encode                                                                        |     44,769 |    125,920 |     21,401 |     23,565 |\n| decode                                                                        |     28,518 |     75,043 |     41,496 |     42,221 |\n| Medium complex object                                                         |            |            |            |            |\n| encode                                                                        |     11,672 |     47,659 |      3,913 |      5,729 |\n| decode                                                                        |     12,522 |     23,599 |      8,007 |      9,720 |\n| Array with 256 True values                                                    |            |            |            |            |\n| encode                                                                        |    110,444 |    425,919 |     81,428 |     84,347 |\n| decode                                                                        |    203,430 |    318,193 |    146,867 |    156,249 |\n| Array with 256 dict{string, int} pairs                                        |            |            |            |            |\n| encode                                                                        |     14,170 |     72,514 |      3,050 |      7,079 |\n| decode                                                                        |     19,116 |     27,542 |      9,374 |     13,713 |\n| Dict with 256 arrays with 256 dict{string, int} pairs                         |            |            |            |            |\n| encode                                                                        |         55 |        282 |         11 |         26 |\n| decode                                                                        |         48 |         53 |         27 |         34 |\n| Dict with 256 arrays with 256 dict{string, int} pairs, outputting sorted keys |            |            |            |            |\n| encode                                                                        |         42 |            |          8 |         27 |\n| Complex object                                                                |            |            |            |            |\n| encode                                                                        |        462 |            |        397 |        444 |\n| decode                                                                        |        480 |        618 |        177 |        310 |\n\nAbove metrics are in call/sec, larger is better.\n\n## Build options\n\nFor those with particular needs, such as Linux distribution packagers, several\nbuild options are provided in the form of environment variables.\n\n### Debugging symbols\n\n#### UJSON_BUILD_NO_STRIP\n\nBy default, debugging symbols are stripped on Linux platforms. Setting this\nenvironment variable with a value of `1` or `True` disables this behavior.\n\n### Using an external or system copy of the double-conversion library\n\nThese two environment variables are typically used together, something like:\n\n```sh\nexport UJSON_BUILD_DC_INCLUDES='/usr/include/double-conversion'\nexport UJSON_BUILD_DC_LIBS='-ldouble-conversion'\n```\n\nUsers planning to link against an external shared library should be aware of\nthe ABI-compatibility requirements this introduces when upgrading system\nlibraries or copying compiled wheels to other machines.\n\n#### UJSON_BUILD_DC_INCLUDES\n\nOne or more directories, delimited by `os.pathsep` (same as the `PATH`\nenvironment variable), in which to look for `double-conversion` header files;\nthe default is to use the bundled copy.\n\n#### UJSON_BUILD_DC_LIBS\n\nCompiler flags needed to link the `double-conversion` library; the default\nis to use the bundled copy.\n","funding_links":[],"categories":["C++","JSON","C","Libraries","Data Format \u0026 I/O","Serialization","HarmonyOS","序列化","Data Serialization"],"sub_categories":["JSON and Data Parsing","For Python","Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fultrajson%2Fultrajson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fultrajson%2Fultrajson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fultrajson%2Fultrajson/lists"}