--- id: json-numpy version: "2.1.1" license: MIT License Copyright (c) 2021-2025 Crimson-Crow Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation… (full text in the JSON record) license_treatment: permissive maintenance: aging --- # json-numpy — JSON encoding/decoding for Numpy arrays and scalars License: permissive · Maintenance: aging · Downloads: 387.8K/mo ## What it is and what it does json-numpy extends Python's built-in json module to handle NumPy arrays and scalars, which the standard library cannot serialize natively. It provides three usage patterns: a drop-in replacement for json functions, explicit encoder/decoder functions for use with the standard json module, or monkey-patching to modify json behavior globally. The package preserves array shape, dtype, and values through the encode-decode cycle without data loss. The package depends only on numpy and supports Python 3.8 through 3.13. It is classified as Production/Stable and has been maintained since its initial release in 2021. The implementation wraps the standard json module's methods, making it straightforward to integrate into existing codebases that already work with NumPy data. Use it for: - Serialize NumPy arrays to JSON for REST API responses or file storage - Deserialize JSON data back into NumPy arrays in data processing pipelines - Enable JSON-based inter-process communication when one process uses NumPy and another expects JSON - Store numerical computation results as JSON while preserving array structure and dtype information - Monkey-patch json in third-party libraries to transparently handle NumPy objects without code modification ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides lossless JSON encoding and decoding for NumPy arrays and scalars, with a drop-in replacement API for the standard json module. Yes. The package solves a genuine gap in Python's standard library with low install friction, permissive licensing, and stable maintenance. It is well-suited for any workflow that needs to serialize NumPy data to JSON. The three usage patterns offer flexibility for different integration scenarios. ## Install pip install json-numpy uv add json-numpy poetry add json-numpy ## Installing json-numpy Before you install: Low friction installation with a single runtime dependency on numpy. The package is marked as Production/Stable and has been actively maintained, with a recent release on 2025-06-30. License in practice: MIT License permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects. Quickstart: import numpy as np import json_numpy arr = np.array([0, 1, 2]) encoded = json_numpy.dumps(arr) decoded = json_numpy.loads(encoded) Verify before relying: - Performance characteristics and memory overhead compared to alternative serialization formats for large arrays - Compatibility with all NumPy scalar types and complex nested data structures ## Package facts - License: MIT License Copyright (c) 2021-2025 Crimson-Crow Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 387.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags numpy json serialization, json encode numpy arrays, numpy array to json, serialize numpy data, json numpy encoder decoder, numpy json conversion, json numpy compatibility, numpy-integration, serialization [View on SkillFed](https://skillfed.io/packages/json-numpy) · [View on PyPI](https://pypi.org/project/json-numpy/)