$npx skillfedfor your agent

json-tricks

Extra features for Python's JSON: comments, order, numpy, pandas, datetimes, and many more! Simple but customizable.

Worth itPyPI Python ModulesReleased Aug 2023205.0K downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — json_tricks-3.17.3-py2.py3-none-any.whl
v3.17.3 · released 2023-08-19

Yes. Low install friction, no runtime dependencies, permissive Revised BSD License, active maintenance, and no known vulnerabilities make it a safe choice. Install it if you need to serialize non-standard Python types to JSON; skip it if you only work with standard JSON types.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Optional dependencies (numpy, pandas, pytz) must be installed separately to serialize those specific types.
  • Low friction install with no runtime dependencies.
  • Actively maintained as of 2026-08-08, with 162 GitHub stars and a stable release history since 2015-11-07.

License · maintenance · safety

permissive license (permissive) — Permissive Revised BSD License allows use in commercial and private projects with minimal restrictions.

last release 2023-08-19 (1091 days) · last repo commit 2026-08-08 · 162 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 204,981 downloads/mo, #9,595 on PyPI

Verify before relying

pip install json-tricks

from json_tricks import dumps, loads, dump, load, strip_comments

json_str = dumps({'data': [1, 2, 3]})
recovered = loads(json_str)
  • Performance characteristics when serializing very large arrays or deeply nested class hierarchies.
  • Current status of pull request and issue handling on the repository.
Same gist for agents: .md · .json

What it is and what it does

json-tricks extends Python's standard json module to serialize and deserialize types that the standard library cannot handle natively. It lets you store arrays in readable format with dtype and shape metadata, save class instances with their module and attribute state, preserve datetime and timezone information as dictionaries, maintain OrderedDict insertion order, and include comments in JSON files by prefixing lines with `#`. Each special type uses a magic key (like `__ndarray__`, `__instance_type__`, `__datetime__`) to signal its type during deserialization.

The package is designed for cases where you need JSON's portability and human readability but work with Python-specific data structures. It supports optional compression for arrays and allows custom serialization via `__json_encode__` and `__json_decode__` methods on your classes. Most features work out of the box, though some require optional dependencies to be installed separately.

Use it for

  • Save arrays to JSON for data interchange while keeping the format human-readable and portable.
  • Serialize Python class instances to JSON for configuration files or inter-process communication.
  • Store datetime and timezone information in JSON without losing precision or context.
  • Preserve dictionary insertion order in JSON files when round-tripping through Python versions.
  • Add comments to JSON configuration files for documentation without breaking JSON parsing.

Worth the install?

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

Worth it

Yes.

Low install friction, no runtime dependencies, permissive Revised BSD License, active maintenance, and no known vulnerabilities make it a safe choice. Install it if you need to serialize non-standard Python types to JSON; skip it if you only work with standard JSON types.

Install

json-tricks on PyPI

Before you install

Low friction install with no runtime dependencies. Actively maintained as of 2026-08-08, with 162 GitHub stars and a stable release history since 2015-11-07.

Optional dependencies (numpy, pandas, pytz) must be installed separately to serialize those specific types.

License in practice

Permissive Revised BSD License allows use in commercial and private projects with minimal restrictions.

Quickstart

pip install json-tricks

from json_tricks import dumps, loads, dump, load, strip_comments

json_str = dumps({'data': [1, 2, 3]})
recovered = loads(json_str)

Verify before relying

  • Performance characteristics when serializing very large arrays or deeply nested class hierarchies.
  • Current status of pull request and issue handling on the repository.

Package facts

Licensepermissive license permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 1,091 days since the last release
Last repo commit
First released
Downloads204,981 / month, #9,595 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableDevelopment Status :: 6 - MatureIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

Evidence: json_tricks-3.17.3-py2.py3-none-any.whl

Tags

Capabilities
json serialization numpy arraysjson with comments pythonserialize class instances jsonjson datetime timezone supportordered dict json preservation
Topics
json-serializationdata-persistence
PyPI keywords
jsonnumpyOrderedDictcommentspandaspytzenumencodedecodeserializedeserialize

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 › “serialize class instances json”

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

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also json-with-comments · json-numpy · json-encoder · typing-json · hjson · numpyencoder · phpserialize · jsonconversion · json-repair · json-timeseries