Skip to main content

No project description provided

Project description

json_partial_py is a resilient JSON parsing library written in Rust that goes beyond the strict JSON specification. It’s designed to parse not only valid JSON but also "JSON‐like" input that may include common syntax errors, multiple JSON objects, or JSON embedded in markdown code blocks.

This is python bindings for json_partial library (Rust).

Usage:

pip install json_partial_py
from pydantic import BaseModel
from json_partial_py import to_json_string

# Example input: A malformed JSON wrapped in Markdown fences.
MALFORMED_JSON = r"""
```json
{"name": "Bob", "age": 25}
```
"""



# Define a simple Pydantic model that matches the expected JSON structure.
class Person(BaseModel):
    name: str
    age: int

json_str = to_json_string(MALFORMED_JSON) 
person = Person.model_validate_json(json_str)
print(person)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

json_partial_python-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (936.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

File details

Details for the file json_partial_python-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for json_partial_python-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 189e0c48b649331c1fea4a443ff0423003b436c988b97857b6ae539e33bc1324
MD5 5956017f532607657c94193c14fc8b76
BLAKE2b-256 e9ff6e10127fd0384f6168e3f8ac6401e39e734ac69b7a3246fa7c09f62db3b1

See more details on using hashes here.

Supported by

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