Skip to main content

bmb-json — Fast JSON Parser

Zero-copy JSON parser and serializer compiled from BMB.

Installation

pip install bmb-json

Quick Start

import bmb_json

bmb_json.validate('{"name": "BMB"}')                  # True
bmb_json.get_string('{"name": "BMB"}', "name")        # "BMB"
bmb_json.get_number('{"version": 97}', "version")     # 97
bmb_json.array_len('[1, 2, 3]')                        # 3
bmb_json.array_get('[10, 20, 30]', 1)                  # '20'
bmb_json.stringify('{ "a" : 1 , "b" : [2,3] }')       # '{"a":1,"b":[2,3]}'
bmb_json.get_type('{"a":1}')                           # 'object'

Full API (12 functions)

Function Description Return
validate(json_str) Check valid JSON bool
stringify(json_str) Roundtrip normalization (minified) str
get_type(json_str) Root value type "null" / "bool" / "number" / "string" / "array" / "object"
get(json_str, key) Get value as raw JSON str (empty if missing)
get_string(json_str, key) Get string value (unquoted) str
get_number(json_str, key) Get number value int (0 if missing)
array_len(json_str) Array length int
array_get(json_str, idx) Array element as JSON str (empty if out of bounds)
has_key(json_str, key) Check if object has key bool
object_len(json_str) Number of keys in object int (-1 for non-objects)
get_bool(json_str, key) Get boolean value int (1/0/-1)
count(json_str) Count elements (shallow) int

All outputs cross-validated against Python's json.loads / json.dumps.

How?

Written in BMB — compile-time contracts prove correctness, then generate code faster than hand-tuned C.

License

MIT

Metadata

Release files for bmb-json 0.2.0

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

Built distributions (wheels)

Table of built distributions (wheels) for bmb-json 0.2.0
File Interpreter ABI Platform Actions
bmb_json-0.2.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for bmb_json-0.2.0-py3-none-win_amd64.whl
bmb_json-0.2.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for bmb_json-0.2.0-py3-none-manylinux_2_17_x86_64.whl
bmb_json-0.2.0-py3-none-macosx_15_0_universal2.whl Python 3 none macOS 15.0+ universal2 (ARM64, x86-64) Details for bmb_json-0.2.0-py3-none-macosx_15_0_universal2.whl

Total release size: 208.4 kB

Release files / bmb_json-0.2.0-py3-none-win_amd64.whl

Download URL bmb_json-0.2.0-py3-none-win_amd64.whl
Size 87.9 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
f506e2fc2d2d37824024c504f55194947e71b27e9896437d6fb631bb317573da
BLAKE2b-256 checksum
How to use checksums
792a7e8bf9de74ca58adb940972736a80f2262b6335f4e2b7876a180cb2ec167
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / bmb_json-0.2.0-py3-none-manylinux_2_17_x86_64.whl

Download URL bmb_json-0.2.0-py3-none-manylinux_2_17_x86_64.whl
Size 69.8 kB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
c6ca39629535fc18afcbc0d19d104b648e7d0f1149ad22f139784d7ee1e14d0a
BLAKE2b-256 checksum
How to use checksums
0a7295e1bf8aedb9e1265f10ee0ea848fb08ce733e38b13e52c923fa3588e34c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / bmb_json-0.2.0-py3-none-macosx_15_0_universal2.whl

Download URL bmb_json-0.2.0-py3-none-macosx_15_0_universal2.whl
Size 50.7 kB
Tags Python 3 macOS 15.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
a9c7169cd9bd974e92db2e3f00a25e8b9da673d65a2341d6f1463121d5720e44
BLAKE2b-256 checksum
How to use checksums
e5beb86cde00632ae2aac95196760fae9cac149674ceb5904011e931e2e25313
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for bmb-json 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

3 release files No provenance

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