jiter is a fast iterable JSON parser for Python, currently at version 0.13.0, released on February 2, 2026. It is actively maintained with a release cadence of approximately every 2-3 months.
pip install jiterVerified import paths — ran on the pinned version, not inferred.
A simple example demonstrating how to parse JSON data using jiter.
Update your Rust dependencies to be compatible with PyO3 0.28.
Use the official 'jiter' package for continued support and updates.
Install the package using pip: `pip install jiter`
Ensure you have the Rust toolchain installed (e.g., `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`). If using poetry, try `poetry add jiter --build=venv` or manually install with pip if the environment is complex. For some environments like Chaquopy, specific `openai` versions might resolve conflicts.
Provide complete and valid JSON bytes to `jiter.from_json()`, or set `partial_mode=True` to allow parsing of incomplete JSON and discard the trailing incomplete string, or `partial_mode='trailing-strings'` to include it.
Example:
```python
import jiter
# Fix: Provide complete JSON
complete_json = b'{"key": "value"}'
parsed_data = jiter.from_json(complete_json)
# Alternative: Allow partial JSON
partial_json = b'{"key": "incomplete st'
parsed_data_partial = jiter.from_json(partial_json, partial_mode=True)
```Ensure the JSON input does not contain objects with duplicate keys, or set `catch_duplicate_keys=False` to allow `jiter` to silently handle (typically by using the last encountered value) duplicate keys.
Example:
```python
import jiter
# Fix: Remove duplicate key
valid_json = b'{"key1": "value1", "key2": "value2"}'
parsed_data = jiter.from_json(valid_json, catch_duplicate_keys=True)
# Alternative: Allow duplicate keys (last one wins by default if not caught)
duplicate_key_json = b'{"key": "value1", "key": "value2"}'
parsed_data_allowed = jiter.from_json(duplicate_key_json, catch_duplicate_keys=False)
```