$npx skillfedfor your agent

canonicaljson

Canonical JSON

Worth itPyPI Software DevelopmentReleased Mar 2023272.6K downloads / moApache License, Version 2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — canonicaljson-2.0.0-py3-none-any.whl
v2.0.0 · released 2023-03-15 · Python >=3.7

Yes. Canonicaljson solves a real problem—deterministic JSON serialization—that the standard library does not address. It has no dependencies, low install friction, active maintenance, a permissive license, and no known vulnerabilities. Install it if your application requires reproducible JSON encoding for signing, hashing, or comparison; skip it if you only need standard JSON serialization.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.7 or newer.
  • Low friction: pure Python wheel with no runtime dependencies.
  • Actively maintained as of 2026-05-06 with production-stable status since its 2015 release.

License · maintenance · safety

Apache License, Version 2.0 (permissive) — Apache License 2.0 (permissive) places no significant restrictions on use, modification, or distribution in proprietary or open-source projects.

last release 2023-03-15 (1248 days) · last repo commit 2026-05-06 · 30 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 272,563 downloads/mo, #8,208 on PyPI

Verify before relying

pip install canonicaljson

import canonicaljson
result = canonicaljson.encode_canonical_json({"key": "value"})
print(result)  # b'{"key":"value"}'
  • Performance characteristics compared to standard library json for large objects.
  • Whether the preserialisation callback mechanism covers all custom type use cases in practice.
Same gist for agents: .md · .json

What it is and what it does

Canonicaljson produces deterministic JSON output by enforcing a canonical form: object keys are always sorted, whitespace is eliminated, and character escaping follows RFC 7159 with minimal sequences. This makes the encoded output identical every time for the same input, which is essential for cryptographic signing, content hashing, and any system where reproducible serialization matters.

The package wraps either simplejson (by default on CPython) or the standard library json module (on PyPy) and adds a preserialisation hook system to handle custom types. It requires Python 3.7 or newer and has no external runtime dependencies, making it lightweight to integrate into existing projects.

Use it for

  • Signing JSON data cryptographically: canonical form ensures signatures remain valid across different serialization libraries.
  • Deduplicating or caching JSON objects: identical input always produces identical bytes, enabling content-addressed storage.
  • Blockchain or ledger applications: deterministic encoding is critical for consensus and transaction verification.
  • API request/response logging: canonical form makes log entries comparable and reduces storage by eliminating whitespace.
  • Testing JSON-producing code: canonical output makes assertions on serialized data deterministic and independent of key order.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Canonicaljson solves a real problem—deterministic JSON serialization—that the standard library does not address. It has no dependencies, low install friction, active maintenance, a permissive license, and no known vulnerabilities. Install it if your application requires reproducible JSON encoding for signing, hashing, or comparison; skip it if you only need standard JSON serialization.

Install

canonicaljson on PyPI

Before you install

Low friction: pure Python wheel with no runtime dependencies. Actively maintained as of 2026-05-06 with production-stable status since its 2015 release.

Requires Python 3.7 or newer.

License in practice

Apache License 2.0 (permissive) places no significant restrictions on use, modification, or distribution in proprietary or open-source projects.

Quickstart

pip install canonicaljson

import canonicaljson
result = canonicaljson.encode_canonical_json({"key": "value"})
print(result)  # b'{"key":"value"}'

Verify before relying

  • Performance characteristics compared to standard library json for large objects.
  • Whether the preserialisation callback mechanism covers all custom type use cases in practice.

Package facts

LicenseApache License, Version 2.0 permissive
Python supportSupports the current Python release >=3.7
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 1,248 days since the last release
Last repo commit
First released
Downloads272,563 / month, #8,208 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 3

Evidence: canonicaljson-2.0.0-py3-none-any.whl

Tags

Capabilities
canonical json encodingdeterministic json serializationsorted keys jsonminimal whitespace jsonrfc 7159 json encoderconsistent json outputjson canonicalization
Topics
json-serializationcryptography-adjacentdeterministic-output
PyPI keywords
json

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “canonical json encoding”

  • canonicaljsonEncodes Python objects to canonical JSON with sorted keys, minimal…
  • jcsCanonicalizes JSON according to RFC 8785, producing a deterministic…
  • canoserCanoser implements canonical serialization for Libra network data…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also jcs · rfc8785 · simplejson · jsonseq · json-encoder · canoser · rison · prison · numpyencoder · demjson3