sed4onnx
Simple ONNX constant encoder/decoder.
What it is and what it does
sed4onnx is a utility for converting constant values in ONNX model files between ASCII and Base64 formats. It sits in a workflow where you export an ONNX model to JSON (with constants Base64-encoded), edit the constant values using sed4onnx to convert them back and forth between human-readable and encoded forms, and then regenerate the modified ONNX file. The package provides both a command-line interface and a Python API with encode() and decode() functions that handle float16, float32, float64, uint8, int8, int16, int32, int64, and string data types.
The package has no external runtime dependencies and installs as a pure Python wheel, making it lightweight and portable. However, it has been abandoned since late 2022 with no maintenance activity since then, so it will not receive updates, bug fixes, or compatibility patches for newer ONNX or Python versions.
Use it for:
- Modify constant tensor values in ONNX models by exporting to JSON, editing constants, and regenerating the model.
- Convert between Base64 and ASCII representations of numeric arrays when working with ONNX constant serialization.
- Batch-encode or decode constant values in a Python script as part of an ONNX model transformation pipeline.
- Inspect and edit ONNX model constants that have been exported to JSON.
- Support workflows that require programmatic modification of ONNX model constants without full model retraining.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encodes and decodes Base64-formatted constant values for ONNX model files, supporting multiple numeric and string data types via CLI or Python API.
Yes, if you are actively working with ONNX model constant modification and can tolerate the lack of maintenance. The package is lightweight, has no dependencies, and does one job well. However, if you need ongoing support, compatibility updates, or are starting a new ONNX workflow, consider whether an actively maintained alternative exists or whether the dormant status poses a risk to your project timeline.
Install
sed4onnx on PyPI
pip
pip install sed4onnxuv
uv add sed4onnxpoetry
poetry add sed4onnxInstalling sed4onnx
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is dormant (last release 2022-12-30, no activity since), so expect no updates or bug fixes going forward.
License in practice
MIT License permits free use, modification, and distribution with minimal restrictions—suitable for both open and closed projects.
Quickstart
pip install -U sed4onnx
from sed4onnx import encode, decode
base64_string = encode(
constant_string='[-1,3,224,224]',
dtype='int64',
)
numpy_ndarray = decode(
constant_string='//////////8DAAAAAAAAAOAAAAAAAAAA4AAAAAAAAAA=',
dtype='int64',
)
Requires Python >=3.6
Verify before relying
- Whether the package works correctly with current ONNX versions and modern Python releases despite no recent maintenance.
- Compatibility with onnx2json and json2onnx tools mentioned in the description—whether those remain functional.
- Performance characteristics when handling large constant values or many encode/decode operations.
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 | abandoned — 1,323 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 82,671/month — #14,145 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sed4onnx-1.0.5-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
json2onnxConverts JSON files to ONNX model format,…
permissive · top 15,000 on PyPI
sam4onnxRewrites attributes and constants in ONNX model…
permissive · top 15,000 on PyPI
onnx2jsonConverts ONNX model files to JSON format,…
permissive · top 15,000 on PyPI
unpaddedbase64Encodes and decodes Base64 data without RFC…
permissive · top 5,000 on PyPI
scs4onnxCompresses ONNX model files by deduplicating…
permissive · top 15,000 on PyPI
sde4onnxRemoves embedded doc_strings from ONNX model…
permissive · top 15,000 on PyPI
simple-onnx-processing-toolsA collection of command-line tools for…
permissive · top 15,000 on PyPI
sng4onnxAutomatically generates and assigns operation…
permissive · top 15,000 on PyPI
ecojiEncodes and decodes binary data as sequences of…
permissive · top 15,000 on PyPI
python-codicefiscaleEncodes and decodes Italian fiscal codes…
permissive · top 15,000 on PyPI