--- id: onnx2json version: "2.0.4" license: MIT License license_treatment: permissive maintenance: abandoned --- # onnx2json — Exports the ONNX file to a JSON file or JSON dict. License: permissive · Maintenance: abandoned · Downloads: 83.0K/mo ## What it is and what it does onnx2json is a command-line and Python library tool that serializes ONNX (Open Neural Network Exchange) model files into JSON format. It reads a binary ONNX file and outputs either a JSON file or an in-memory dictionary representation of the model's structure, graph, and metadata. The tool supports customizable JSON indentation and can work with pre-loaded ONNX graph objects. The package is designed for developers who need to inspect, analyze, or transform ONNX models in a human-readable or programmatically accessible format. It has no runtime dependencies beyond Python itself, making it lightweight to install. However, it is no longer actively maintained—the last release was in January 2023, and the repository shows no recent commits, meaning it will not receive updates for new ONNX features or Python versions. Use it for: - Inspect the structure and metadata of an ONNX neural network model for debugging or documentation. - Convert ONNX models to JSON for integration with web-based model viewers or analysis tools. - Programmatically extract and manipulate ONNX model information in Python scripts. - Serialize ONNX graphs to JSON as an intermediate step in model transformation pipelines. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Converts ONNX model files to JSON format, either writing to a file or returning a dictionary representation of the model structure. Yes, if you need to convert ONNX models to JSON and are working with models from before early 2023. The package is stable, has no dependencies, and carries no known vulnerabilities. However, do not rely on it for long-term maintenance or support for cutting-edge ONNX features—it is abandoned. If you need active development or compatibility with the latest ONNX specifications, consider alternatives or maintain a fork. ## Install pip install onnx2json uv add onnx2json poetry add onnx2json ## Installing onnx2json Before you install: Installs with no runtime dependencies and low friction. However, the package is abandoned—last release was 2023-01-25 and no commits since then. It will not receive updates or security patches. License in practice: MIT License permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license text. Quickstart: pip install onnx2json from onnx2json import convert onnx_json = convert( input_onnx_file_path="model.onnx", output_json_path="model.json", json_indent=2 ) Requires Python 3.6 or later. The ONNX model file must exist at the specified path. Verify before relying: - Whether the package handles all ONNX opset versions correctly or only specific versions. - Performance characteristics when converting large or complex ONNX models. - Compatibility with recent ONNX library versions released after 2023. ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 83.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags onnx to json conversion, export onnx model json, onnx file serialization, neural network model format conversion, onnx model inspection tool, model-serialization, onnx-tools [View on SkillFed](https://skillfed.io/packages/onnx2json) · [View on PyPI](https://pypi.org/project/onnx2json/)