{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/16"}],"enrichment":{"capability":"Extends Python's JSON serialization to handle numpy arrays, class instances, datetimes, OrderedDict, comments, and other non-standard types while preserving human readability.","skillfed_tags":["json-serialization","data-persistence"],"use_cases":["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."],"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.\n\nThe 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.","worth_installing":"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."},"id":"json-tricks","links":{"html":"https://skillfed.io/packages/json-tricks","md":"https://skillfed.io/packages/json-tricks.md","pypi":"https://pypi.org/project/json-tricks/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2023-08-19","license_spdx":null,"license_treatment":"permissive","name":"json-tricks","python_support":"unspecified","summary":"Extra features for Python's JSON: comments, order, numpy, pandas, datetimes, and many more! Simple but customizable."},"popularity":{"monthly_downloads":204981,"position":9595,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"3.17.3"}
