{"id":21692545,"url":"https://github.com/lukesavefrogs/python21-json","last_synced_at":"2025-03-20T13:54:44.962Z","repository":{"id":264512511,"uuid":"623328648","full_name":"LukeSavefrogs/python21-json","owner":"LukeSavefrogs","description":"Implementation of the standard json module with support for Python \u003c 2.3","archived":false,"fork":false,"pushed_at":"2023-04-17T10:55:48.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T19:08:04.951Z","etag":null,"topics":["backport","json","json-parser","legacy-python","python-legacy","python2","python2-legacy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LukeSavefrogs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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},"funding":{"github":"LukeSavefrogs","patreon":"LukeSavefrogs","ko_fi":"lukesavefrogs","custom":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=RN3XMAHA8FZEE\u0026source=url"]}},"created_at":"2023-04-04T06:43:43.000Z","updated_at":"2023-04-07T10:01:03.000Z","dependencies_parsed_at":"2024-11-24T20:11:53.087Z","dependency_job_id":"1c7fa45c-3bea-4b5c-946d-ba0a2f2f4533","html_url":"https://github.com/LukeSavefrogs/python21-json","commit_stats":null,"previous_names":["lukesavefrogs/python21-json"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeSavefrogs%2Fpython21-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeSavefrogs%2Fpython21-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeSavefrogs%2Fpython21-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeSavefrogs%2Fpython21-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukeSavefrogs","download_url":"https://codeload.github.com/LukeSavefrogs/python21-json/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244623142,"owners_count":20483082,"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":["backport","json","json-parser","legacy-python","python-legacy","python2","python2-legacy"],"created_at":"2024-11-25T18:16:26.887Z","updated_at":"2025-03-20T13:54:44.921Z","avatar_url":"https://github.com/LukeSavefrogs.png","language":"Python","funding_links":["https://github.com/sponsors/LukeSavefrogs","https://patreon.com/LukeSavefrogs","https://ko-fi.com/lukesavefrogs","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=RN3XMAHA8FZEE\u0026source=url"],"categories":[],"sub_categories":[],"readme":"# python2-json\nBasic implementation of a **JSON parser** written in pure Python and created as a **drop-in replacement** (_well, almost_) for the `json` module in environments using **very old Python versions** (`2.2` and lower).\n\nProvides `loads`, `dumps` and their counterparts `load` and `dump`.\n\n\u003e **_Please note that speed is clearly not the focus here..._** \n\n## Features\n- **Same function names** and signature: `loads`, `dumps`, `load`, `dump`;\n- Handles all **base JSON types**:\n  - _Arrays_: `[]`\n  - _Objects_: `{}`\n  - _Strings_: `\"\"`\n  - _Numbers_: integers (`3`), floating point (`3.14`), exponential (`3.14e10`)\n  - _Boolean_: `true` and `false`\n  - _Null_: `null`\n- Handles **nested data structures**, such as:\n\t```json\n\t{ \"key\": \"value\", \"nested\": [{\"name\": \"first\", \"elems\": [1, true, null]}] }\n\t```\n\n\tIf passed through the `loads(...)` method will return:\n\t```python\n\t{'key': 'value', 'nested': [{'name': 'first', 'elems': [1, True, None]}]}\n\t```\n\n\n## Known limitations \u0026 gotchas \n### Gotchas 👀\n- `Infinity` and `NaN` currently do not follow strictly the `json` module rules (still no `allow_nan` parameter).\n- If using this module on **Python 2.3 and lower** you MUST pass `truthy_value` and `falsy_value`;\n\n### Known bugs 🐛\nThese are some known bugs that will be fixed in the next releases:\n- **Does not convert unicode strings** to the respective character and viceversa (e.g. `\\u1eb7` is not converted to `ặ`).\n\t```\n\t\u003e\u003e\u003e json.loads('\"\\\\u1eb7 \\\\u00a3\"')\n\t- ORIGINAL: 'ặ £'\n\t- THIS    : '\\\\u1eb7 \\\\u00a3'\n\n\t\u003e\u003e\u003e json.dumps('ặ £')\n\t- ORIGINAL: '\"\\\\u1eb7 \\\\u00a3\"'\n\t- THIS    : '\"ặ £\"'\n\t```\n\n- Has some problems with **backslashes** (e.g. `\\n` is not converted to `\\\\n`).\n\t```\n\t\u003e\u003e\u003e json.loads(r'\"\\\" \\\\ \\/ \\b \\f \\n \\r \\t\"')\n\t- ORIGINAL: '\" \\\\ / \\x08 \\x0c \\n \\r \\t'\n\t- THIS    : '\" \\\\ / \\x08 \\x0c \\n \\r \\t'\n\n\t\u003e\u003e\u003e json.dumps('\" \\\\ / \\x08 \\x0c \\n \\r \\t')\n\t- ORIGINAL: '\"\\\\\" \\\\\\\\ / \\\\b \\\\f \\\\n \\\\r \\\\t\"'\n\t- THIS    : '\"\\\\\" \\\\\\\\ / \\x08 \\x0c \\n \\r \\t\"'\n\t```\n\n\n\n## Resources\n- [JSON specification](https://www.json.org/json-en.html)\n\n# Valid alternatives\nThese are some valid alternatives if this is not what you're looking for (_as it probably is and should be_), ordered by minimum supported version.\n\n\u003ctable\u003e\n\t\u003cthead\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003cth\u003eLibrary\u003c/th\u003e\n\t\t\t\u003cth\u003eDescription\u003c/th\u003e\n\t\t\t\u003cth\u003eBuilt-in\u003c/th\u003e\n\t\t\t\u003cth\u003eSupported Python versions\u003c/th\u003e\n\t\t\u003c/tr\u003e\n\t\u003c/thead\u003e\n\t\u003ctbody\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ccode\u003e\u003ca href=\"https://github.com/simplejson/simplejson/tree/python2.2\"\u003esimplejson/python2.2\u003c/a\u003e\u003c/code\u003e\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\tBranch of the \u003ccode\u003esimplejson\u003c/code\u003e library that mantains backwards compatibility with Python 2.2.\n\t\t\t\tMakes use of generator functions that were introduced in Python 2.2 (via \u003ca href=\"https://peps.python.org/pep-0255/\"\u003ePEP 255\u003c/a\u003e).\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\tNo\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ccode\u003ePython \u003e= 2.2\u003c/code\u003e\n\t\t\t\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ccode\u003e\u003ca href=\"https://github.com/dmeranda/demjson\"\u003edemjson\u003c/a\u003e\u003c/code\u003e\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\tFeature rich module that uses only built-in methods and allows to encode, decode and syntax-checking JSON data.\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\tNo\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ca href=\"https://github.com/dmeranda/demjson/blob/5bc65974e7141746acc88c581f5d2dfb8ea14064/docs/INSTALL.txt#L8-L10\"\u003e\u003ccode\u003ePython \u003e= 2.4\u003c/code\u003e\u003c/a\u003e\n\t\t\t\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ccode\u003e\u003ca href=\"https://github.com/simplejson/simplejson\"\u003esimplejson\u003c/a\u003e\u003c/code\u003e\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\tExternally maintained development version of the built-in \u003ccode\u003ejson\u003c/code\u003e library included with Python.\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\tNo\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ca href=\"https://github.com/simplejson/simplejson/blob/9559fc756deaf20b6bae961b58c5289d8582c8b7/README.rst?plain=1#L4-L6\"\u003e\u003ccode\u003ePython \u003e= 2.5\u003c/code\u003e\u003c/a\u003e\n\t\t\t\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ccode\u003e\u003ca href=\"https://docs.python.org/3/library/json.html\"\u003ejson\u003c/a\u003e\u003c/code\u003e\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003cb\u003eBuilt-in\u003c/b\u003e library included with Python.\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ci\u003eYes\u003c/i\u003e\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ccode\u003ePython \u003e= 2.6\u003c/code\u003e\n\t\t\t\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ccode\u003e\u003ca href=\"https://github.com/ijl/orjson\"\u003eorjson\u003c/a\u003e\u003c/code\u003e\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\tFast JSON library written in Rust that serializes various data structures, such as \u003ccode\u003edataclass\u003c/code\u003e, \u003ccode\u003edatetime\u003c/code\u003e/\u003ccode\u003edate\u003c/code\u003e/\u003ccode\u003etime\u003c/code\u003e and \u003ccode\u003enumpy.ndarray\u003c/code\u003e instances.\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\tNo\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ca href=\"https://github.com/ijl/orjson/blob/a60506c77e7051774dddd86bb8c12ec4a79223d5/README.md?plain=1#L35\"\u003e\u003ccode\u003eCPython \u003e= 3.7\u003c/code\u003e\u003c/a\u003e\n\t\t\t\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ccode\u003e\u003ca href=\"https://github.com/ultrajson/ultrajson\"\u003eujson\u003c/a\u003e\u003c/code\u003e\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\tUltra fast JSON encoder and decoder written in pure C.\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\tNo\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ca href=\"https://github.com/ultrajson/ultrajson/blob/6035e09077e6bd3e8e3e91162bb1232507967735/README.md?plain=1#L11-L12\"\u003e\u003ccode\u003ePython \u003e= 3.7\u003c/code\u003e\u003c/a\u003e\n\t\t\t\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\t\u003ctr\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ccode\u003e\u003ca href=\"https://github.com/python-rapidjson/python-rapidjson\"\u003epython-rapidjson\u003c/a\u003e\u003c/code\u003e\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\tPython 3 wrapper around \u003ccode\u003eRapidJSON\u003c/code\u003e, an extremely fast C++ JSON parser and serialization library\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\tNo\n\t\t\t\u003c/td\u003e\n\t\t\t\u003ctd\u003e\n\t\t\t\t\u003ccode\u003ePython \u003e= 3.x\u003c/code\u003e\u003cbr\u003e\u003ci\u003e(unknown minor)\u003c/i\u003e\n\t\t\t\u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\u003c/tbody\u003e\n\u003c/table\u003e\n\n\n# Development\n1. **Clone** the repository\n2. **Install** with `poetry install --with dev`\n\n### Tests\n**Tests ensure** that changes to the codebase **do not break existing features** and that anything **works as expected**.\n\nTo launch the tests run the following command:\n```\npoetry run poe test\n```\n\nPlease make sure to...\n- ... keep existing tests up-to-date with the latest **changes**;\n- ... write relative tests when adding **new features**.\n\n#### Tests code style\nWhen writing tests please keep the in mind that:\n- test files MUST be written for `unittest`;\n- _test cases_ names MUST be a descriptive name written in PascalCase and end with `TestCase` (e.g. `class MyTestCase(unittest.TestCase):`);\n- _test_ names MUST be a descriptive name written in snake_case (_all lowercase, with words separated with an underscore_) and start with `test_` (e.g. `def test_feature(self):`);\n- MAY use the [`setUp()`](https://docs.python.org/3/library/unittest.html#unittest.TestCase.setUp) and [`teardown()`](https://docs.python.org/3/library/unittest.html#unittest.TestCase.tearDown) methods to define instructions that will be executed before and after each test method;\n- each test MUST contain at least one `self.assert*` method call (we don't want empty no-op tests);\n\nThe following is an example of agood test from the official Python documentation:\n```python\nimport unittest\n\nclass WidgetTestCase(unittest.TestCase):\n    def setUp(self):\n        self.widget = Widget('The widget')\n\n    def tearDown(self):\n        self.widget.dispose()\n\n    def test_default_widget_size(self):\n        self.assertEqual(\n\t\t\tself.widget.size(),\n\t\t\t(50,50),\n            'incorrect default size'\n\t\t)\n\n    def test_widget_resize(self):\n        self.widget.resize(100,150)\n        self.assertEqual(\n\t\t\tself.widget.size(),\n\t\t\t(100,150),\n            'wrong size after resize'\n\t\t)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukesavefrogs%2Fpython21-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukesavefrogs%2Fpython21-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukesavefrogs%2Fpython21-json/lists"}