{"id":14977834,"url":"https://github.com/crimson-crow/json-numpy","last_synced_at":"2025-07-29T11:33:23.177Z","repository":{"id":62572907,"uuid":"377413987","full_name":"Crimson-Crow/json-numpy","owner":"Crimson-Crow","description":"JSON encoding/decoding for Numpy arrays and scalars","archived":false,"fork":false,"pushed_at":"2024-10-10T16:43:46.000Z","size":23,"stargazers_count":20,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T04:37:48.902Z","etag":null,"topics":["encoding-decoding","json","numpy","python","serialization"],"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/Crimson-Crow.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}},"created_at":"2021-06-16T07:47:37.000Z","updated_at":"2025-04-25T03:12:10.000Z","dependencies_parsed_at":"2025-02-13T06:43:27.874Z","dependency_job_id":null,"html_url":"https://github.com/Crimson-Crow/json-numpy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Crimson-Crow/json-numpy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crimson-Crow%2Fjson-numpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crimson-Crow%2Fjson-numpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crimson-Crow%2Fjson-numpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crimson-Crow%2Fjson-numpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Crimson-Crow","download_url":"https://codeload.github.com/Crimson-Crow/json-numpy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crimson-Crow%2Fjson-numpy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267678448,"owners_count":24126333,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["encoding-decoding","json","numpy","python","serialization"],"created_at":"2024-09-24T13:56:24.659Z","updated_at":"2025-07-29T11:33:23.171Z","avatar_url":"https://github.com/Crimson-Crow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"json-numpy\n==========\n\n[![PyPI](https://img.shields.io/pypi/v/json-numpy)](https://pypi.org/project/json-numpy/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/json-numpy)](https://pypi.org/project/json-numpy/)\n[![GitHub](https://img.shields.io/github/license/Crimson-Crow/json-numpy)](https://github.com/Crimson-Crow/json-numpy/blob/main/LICENSE.txt)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://makeapullrequest.com)\n\nDescription\n-----------\n\n`json-numpy` provides lossless and quick JSON encoding/decoding for [NumPy](http://www.numpy.org/) arrays and scalars.\n\n`json-numpy` follows [Semantic Versioning](https://semver.org/).\n\nInstallation\n------------\n\n`json-numpy` can be installed using [`pip`](https://pip.pypa.io/en/stable/):\n\n    $ pip install json-numpy\n\nUsage\n-----\n\nFor a quick start, `json_numpy` can be used as a simple drop-in replacement of the built-in `json` module. \\\nThe `dump()`, `load()`, `dumps()` and `loads()` methods are implemented by wrapping the original methods and replacing the default encoder and decoder. \\\nMore information on the usage can be found in the `json` module's [documentation](https://docs.python.org/3/library/json.html).\n\n```python\nimport numpy as np\nimport json_numpy\n\narr = np.array([0, 1, 2])\nencoded_arr_str = json_numpy.dumps(arr)\ndecoded_arr = json_numpy.loads(encoded_arr_str)\n```\n\nAnother way of using `json_numpy` is to explicitly use the provided encoder and decoder functions in conjunction with the `json` module.\n\n```python\nimport json\nimport numpy as np\nfrom json_numpy import default, object_hook\n\narr = np.array([0, 1, 2])\nencoded_arr_str = json.dumps(arr, default=default)\ndecoded_arr = json.loads(encoded_arr_str, object_hook=object_hook)\n```\n\nFinally, the last way of using `json_numpy` is by monkey patching the `json` module after importing it first:\n\n```python\nimport json\nimport numpy as np\nimport json_numpy\n\njson_numpy.patch()\n\narr = np.array([0, 1, 2])\nencoded_arr_str = json.dumps(arr)\ndecoded_arr = json.loads(encoded_arr_str)\n```\n\nThis method can be used to change the behavior of a module depending on the `json` module without editing its code.\n\nTests\n-----\n\nThe simplest way to run tests is:\n\n    $ python -m unittest\n\nAs a more robust alternative, you can install [`tox`](https://tox.readthedocs.io/en/latest/install.html) to automatically test across the supported python versions, then run:\n\n    $ tox\n\nIssue tracker\n-------------\n\nPlease report any bugs or enhancement ideas using the [issue tracker](https://github.com/Crimson-Crow/json-numpy/issues).\n\nLicense\n-------\n\n`json-numpy` is licensed under the terms of the [MIT License](https://opensource.org/licenses/MIT) (see [LICENSE.txt](https://github.com/Crimson-Crow/json-numpy/blob/main/LICENSE.txt) for more information).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrimson-crow%2Fjson-numpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrimson-crow%2Fjson-numpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrimson-crow%2Fjson-numpy/lists"}