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.1

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.1
File Size Uploaded
nya_json_type-0.1.1.tar.gz 13.5 kB Details

Built distribution (wheel)

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

Total release size: 16.2 kB

Release files / nya_json_type-0.1.1.tar.gz

Download URL nya_json_type-0.1.1.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
55b9fb585d5b7a73ec5f9faafea945e796d1a7af782fc6968434c53a347374de
BLAKE2b-256 checksum
How to use checksums
230465f5f60a443020aa9a09e6130a2628d6c20877c02780c34d869c8f09f9aa
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.1-py3-none-any.whl

Download URL nya_json_type-0.1.1-py3-none-any.whl
Size 2.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c32615e2d6b1396f7922c3cd9feaee8d62486dfa71b47c25477d0fbaeae3a90
BLAKE2b-256 checksum
How to use checksums
e04a6d34fe5e136634bb0812fb9d8a9437aede0d66f63cfd81ef1c878b97a43e
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

This release

0.1.1 This release

2 release files

0.1.0

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