--- id: jsonalias version: "0.1.2" license: MIT license_treatment: permissive maintenance: dormant --- # jsonalias — A microlibrary that defines a Json type alias for Python. License: permissive · Maintenance: dormant · Downloads: 1.4M/mo ## What it is and what it does jsonalias exports a single recursive type alias, `Json`, that represents any valid JSON value: a dictionary with string keys and JSON values, a list of JSON values, or a primitive (string, integer, float, boolean, or None). The alias is defined using Python's `typing` module and supports recursive self-reference, allowing you to annotate variables and function parameters that hold JSON-compatible data. The package exists because this type alias is useful across multiple projects but verbose enough to be tedious to redefine. It requires mypy >= 0.981 with the --enable-recursive-aliases flag to type-check correctly. The implementation is minimal—just a few lines of type definition—and carries no runtime dependencies, making it a zero-cost addition to your type-checking workflow. Use it for: - Annotate function parameters that accept arbitrary JSON data from APIs or file parsing - Type-hint configuration dictionaries or settings objects with mixed nested structures - Define return types for JSON serialization or deserialization functions - Validate type consistency in data transformation pipelines that work with JSON - Document expected shapes for dynamically-structured data in codebases using strict typing ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a recursive type alias for JSON-compatible data structures in Python, enabling type hints for dictionaries, lists, and primitive values. Yes, if you use type hints and work with JSON data. The package is stable, has no dependencies, and solves a genuine typing problem. Dormant maintenance is not a concern for a minimal, self-contained type alias. Verify mypy version and configuration requirements before adopting in strict type-checking environments. ## Install pip install jsonalias uv add jsonalias poetry add jsonalias ## Installing jsonalias Before you install: Low friction: pure Python, no runtime dependencies, distributed as a wheel. Dormant maintenance (last release October 2022, last commit January 2025) but the package is minimal and stable—no active development needed. License in practice: MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal attribution requirements. Quickstart: from jsonalias import Json d: Json = {"foo": ["bar", {"x": "y"}]} Requires mypy >= 0.981 with --enable-recursive-aliases flag for type checking to work correctly. Verify before relying: - Whether mypy >= 0.981 with --enable-recursive-aliases is a hard requirement or merely recommended for full type-checking support - Compatibility with type checkers other than mypy (e.g., pyright, pyre) ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 1.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags json type alias python, typing json recursive, json type hint, python json typing, recursive type alias json, typing, json-schema [View on SkillFed](https://skillfed.io/packages/jsonalias) · [View on PyPI](https://pypi.org/project/jsonalias/)