{"id":21486,"library":"json-numpy","title":"json-numpy","description":"A library for encoding and decoding NumPy arrays and scalars to/from JSON-compatible formats. Current version 2.1.1, compatible with Python >=3.8. Maintained actively.","status":"active","version":"2.1.1","language":"python","source_language":"en","source_url":"https://github.com/Crimson-Crow/json-numpy.git","tags":["numpy","json","serialization","encoding","decoding","arrays"],"install":[{"cmd":"pip install json-numpy","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Core dependency for array handling","package":"numpy","optional":false}],"imports":[{"note":"Direct import of the module for conversion functions.","symbol":"json_numpy","correct":"import json_numpy"}],"quickstart":{"code":"import json_numpy\nimport numpy as np\n\narr = np.array([1, 2, 3])\nencoded = json_numpy.dumps(arr)\nprint(encoded)\ndecoded = json_numpy.loads(encoded)\nprint(decoded)","lang":"python","description":"Basic usage: encode NumPy array to JSON string and decode back."},"warnings":[{"fix":"Use json_numpy.dumps(obj, allow_nan=True).","message":"json_numpy.dumps does not encode Infinity or NaN by default; they become null. To preserve them, pass allow_nan=True.","severity":"gotcha","affected_versions":"all"},{"fix":"Use json_numpy.loads(s, as_list=True) or explicit list() after decode.","message":"Deserialization returns numpy arrays by default. To get Python lists, convert manually.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.1.1':21 '3.8':25 'activ':27 'array':11,33 'compat':17,22 'current':19 'decod':9,32 'encod':7,31 'format':18 'json':2,16,29 'json-compat':15 'json-numpi':1 'librari':5 'maintain':26 'numpi':3,10,28 'python':24 'scalar':13 'serial':30 'to/from':14 'version':20","created_at":"2026-04-27T17:00:08.810116+00:00","updated_at":"2026-04-27T17:00:08.810116+00:00","problems":[{"fix":"Use json_numpy.dumps() and json_numpy.loads() after importing json_numpy.","cause":"Incorrect import assuming dumps/loads are top-level; they are inside json_numpy module.","error":"AttributeError: module 'json_numpy' has no attribute 'dumps'"},{"fix":"Use json_numpy.dumps(arr) instead of json.dumps(arr).","cause":"Using standard json.dumps directly on numpy arrays.","error":"TypeError: Object of type ndarray is not JSON serializable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.1.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/Crimson-Crow/json-numpy","docs":null,"changelog":null,"pypi":"https://pypi.org/project/json-numpy/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}