Skip to main content

Fast iterable JSON parser.

Project description

jiter

CI pypi versions license

This is a standalone version of the JSON parser used in pydantic-core. The recommendation is to only use this package directly if you do not use pydantic.

The API is extremely minimal:

def from_json(
    json_data: bytes,
    /,
    *,
    allow_inf_nan: bool = True,
    cache_mode: Literal[True, False, "all", "keys", "none"] = "all",
    partial_mode: Literal[True, False, "off", "on", "trailing-strings"] = False,
    catch_duplicate_keys: bool = False,
    lossless_floats: bool = False,
) -> Any:
    """
    Parse input bytes into a JSON object.

    Arguments:
        json_data: The JSON data to parse
        allow_inf_nan: Whether to allow infinity (`Infinity` an `-Infinity`) and `NaN` values to float fields.
            Defaults to True.
        cache_mode: cache Python strings to improve performance at the cost of some memory usage
            - True / 'all' - cache all strings
            - 'keys' - cache only object keys
            - False / 'none' - cache nothing
        partial_mode: How to handle incomplete strings:
            - False / 'off' - raise an exception if the input is incomplete
            - True / 'on' - allow incomplete JSON but discard the last string if it is incomplete
            - 'trailing-strings' - allow incomplete JSON, and include the last incomplete string in the output
        catch_duplicate_keys: if True, raise an exception if objects contain the same key multiple times
        lossless_floats: if True, preserve full detail on floats using `LosslessFloat`

    Returns:
        Python object built from the JSON input.
    """

def cache_clear() -> None:
    """
    Reset the string cache.
    """

def cache_usage() -> int:
    """
    get the size of the string cache.

    Returns:
        Size of the string cache in bytes.
    """

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jiter-0.4.0.tar.gz (158.0 kB view hashes)

Uploaded Source

Built Distributions

jiter-0.4.0-cp312-none-win_amd64.whl (200.1 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

jiter-0.4.0-cp312-none-win32.whl (207.4 kB view hashes)

Uploaded CPython 3.12 Windows x86

jiter-0.4.0-cp312-cp312-musllinux_1_1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

jiter-0.4.0-cp312-cp312-musllinux_1_1_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ ARM64

jiter-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (326.7 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

jiter-0.4.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.2 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ s390x

jiter-0.4.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ppc64le

jiter-0.4.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARMv7l

jiter-0.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

jiter-0.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.5+ i686

jiter-0.4.0-cp312-cp312-macosx_11_0_arm64.whl (311.9 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

jiter-0.4.0-cp312-cp312-macosx_10_12_x86_64.whl (303.3 kB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

jiter-0.4.0-cp311-none-win_amd64.whl (202.1 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

jiter-0.4.0-cp311-none-win32.whl (206.2 kB view hashes)

Uploaded CPython 3.11 Windows x86

jiter-0.4.0-cp311-cp311-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

jiter-0.4.0-cp311-cp311-musllinux_1_1_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ ARM64

jiter-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (327.7 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

jiter-0.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ s390x

jiter-0.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ppc64le

jiter-0.4.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARMv7l

jiter-0.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

jiter-0.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.5+ i686

jiter-0.4.0-cp311-cp311-macosx_11_0_arm64.whl (313.6 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

jiter-0.4.0-cp311-cp311-macosx_10_12_x86_64.whl (304.6 kB view hashes)

Uploaded CPython 3.11 macOS 10.12+ x86-64

jiter-0.4.0-cp310-none-win_amd64.whl (203.9 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

jiter-0.4.0-cp310-none-win32.whl (206.9 kB view hashes)

Uploaded CPython 3.10 Windows x86

jiter-0.4.0-cp310-cp310-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

jiter-0.4.0-cp310-cp310-musllinux_1_1_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ ARM64

jiter-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (327.8 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

jiter-0.4.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ s390x

jiter-0.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ppc64le

jiter-0.4.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARMv7l

jiter-0.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

jiter-0.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ i686

jiter-0.4.0-cp310-cp310-macosx_11_0_arm64.whl (312.7 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

jiter-0.4.0-cp310-cp310-macosx_10_12_x86_64.whl (305.4 kB view hashes)

Uploaded CPython 3.10 macOS 10.12+ x86-64

jiter-0.4.0-cp39-none-win_amd64.whl (204.7 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

jiter-0.4.0-cp39-none-win32.whl (207.9 kB view hashes)

Uploaded CPython 3.9 Windows x86

jiter-0.4.0-cp39-cp39-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

jiter-0.4.0-cp39-cp39-musllinux_1_1_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ ARM64

jiter-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (328.1 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

jiter-0.4.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ s390x

jiter-0.4.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ppc64le

jiter-0.4.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARMv7l

jiter-0.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

jiter-0.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ i686

jiter-0.4.0-cp39-cp39-macosx_11_0_arm64.whl (304.6 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

jiter-0.4.0-cp39-cp39-macosx_10_12_x86_64.whl (305.0 kB view hashes)

Uploaded CPython 3.9 macOS 10.12+ x86-64

jiter-0.4.0-cp38-none-win_amd64.whl (204.2 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

jiter-0.4.0-cp38-none-win32.whl (207.8 kB view hashes)

Uploaded CPython 3.8 Windows x86

jiter-0.4.0-cp38-cp38-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

jiter-0.4.0-cp38-cp38-musllinux_1_1_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ ARM64

jiter-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (328.0 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

jiter-0.4.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ s390x

jiter-0.4.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ppc64le

jiter-0.4.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARMv7l

jiter-0.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

jiter-0.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ i686

jiter-0.4.0-cp38-cp38-macosx_11_0_arm64.whl (304.2 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

jiter-0.4.0-cp38-cp38-macosx_10_12_x86_64.whl (305.1 kB view hashes)

Uploaded CPython 3.8 macOS 10.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page