Skip to main content

nya-json-type

Provide a Json type that is defined as follows:

type Json = dict[str, Json] | list[Json] | str | int | float | bool | None

This type is supposed to be a typed return value of the builtin library json's .loads()/.load() function

Usage

import json
from nya_json_type import Json

x: Json = json.load("data.json")

Motivation

This allows for typechecker narrowing. I know PyPI is not npm, but this small packages work fine for me and i was sick of having to cupy-paste that snippet of code everywhere. ~nya

Release files for nya-json-type 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nya-json-type 0.1.0
File Size Uploaded
nya_json_type-0.1.0.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nya-json-type 0.1.0
File Interpreter ABI Platform
nya_json_type-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.3 kB

Release files / nya_json_type-0.1.0.tar.gz

Download URL nya_json_type-0.1.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
aa78f31bbdc43d5b053cb38e25a25ce63f172db376698350595f929ee4974aea
BLAKE2b-256 checksum
How to use checksums
971d54f5d49cbff2897ec9d56671a7815d7fd5061e6e733bfc04496d808c3eda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nya_json_type-0.1.0-py3-none-any.whl

Download URL nya_json_type-0.1.0-py3-none-any.whl
Size 1.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
557d394af5bc3141ddd0579e930ae6f020cff14c6d791007329f07746d3b9ba2
BLAKE2b-256 checksum
How to use checksums
fd967f70072759645db9b018006a0be9409dff8af85a9cdfe3e3247ad21d1fc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page