skillfed

sng4onnx

A simple tool that automatically generates and assigns an OP name to each OP in an old format ONNX file.

sng4onnx v2.0.1 307.2K downloads/30d#7,779 on PyPI2
Permissive license MIT License Active released

What it is and what it does

sng4onnx is a lightweight command-line and Python utility that solves a specific ONNX workflow problem: older ONNX model files sometimes lack proper operation names, making them harder to inspect, debug, or process. This tool automatically traverses an ONNX graph and generates systematic names for any unnamed operators, then writes the corrected model back to disk or returns it as a Python object.

The package works both as a CLI tool (via `sng4onnx` command) and as an importable Python function. It requires only Python 3.6 or later and has no external runtime dependencies beyond what ONNX itself needs. The tool is part of a broader collection of simple ONNX processing utilities and is maintained actively.

Use it for:

  • Prepare legacy ONNX models for inspection or visualization by ensuring all operators have readable names
  • Preprocess ONNX files before feeding them into model analysis or debugging tools that expect named operations
  • Batch-convert a collection of old-format ONNX models to have consistent operation naming conventions
  • Integrate into an ONNX model pipeline to normalize graph structure before downstream processing
  • Verify and repair ONNX files exported from older frameworks or converters that may not name all operations

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Automatically generates and assigns operation names to unnamed operators in ONNX model files, converting old-format ONNX graphs to have properly named operations.

Yes. Install if you work with ONNX models and need to normalize operation names in older or unconventionally formatted files. The tool is lightweight, actively maintained, has no complex dependencies, carries a permissive MIT license, and solves a real ONNX workflow problem. No security vulnerabilities are known.

Install

sng4onnx on PyPI

pip

pip install sng4onnx

uv

uv add sng4onnx

poetry

poetry add sng4onnx

Installing sng4onnx

Before you install

Low install friction with no runtime dependencies. Actively maintained as of 2026-02-24 with recent updates.

License in practice

MIT License permits unrestricted use, modification, and distribution with minimal restrictions.

Quickstart

pip install sng4onnx

from sng4onnx import generate

onnx_graph = generate(
    input_onnx_file_path="model.onnx",
    output_onnx_file_path="model_renamed.onnx"
)

Verify before relying

  • Whether the tool handles all ONNX operator types or only a subset
  • Performance characteristics on large models with thousands of operations
  • Compatibility with ONNX versions beyond the current release

Package facts

License MIT License (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 171 days since the last release
Last repo commit
First released
Downloads 307,157/month — #7,779 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sng4onnx-2.0.1-py3-none-any.whl

Tags

onnx operator namingonnx op name generatorrename onnx operationsonnx model preprocessingonnx graph operation namessimple onnx toolsonnx file conversion
onnx-toolsmodel-preprocessing

More Artificial Intelligence packages