Observed since 21 Oct, 11:25 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Python bindings for the JSON Alchemy C library
Python bindings for the JSON Alchemy C library - a high-performance JSON processing toolkit.
pip install aimv2-json-alchemy
The cJSON library is now included directly in the repository, so you don't need to install it separately.
For more detailed installation instructions, see INSTALL.md.
import json
from json_alchemy import flatten_json, flatten_json_batch
# Single object flattening
nested_json_str = '''
{
"person": {
"name": "John",
"age": 30,
"address": {
"city": "New York",
"zip": "10001"
}
}
}
'''
flat_json = flatten_json(nested_json_str)
print(flat_json)
# Output:
# {
# "person.name": "John",
# "person.age": 30,
# "person.address.city": "New York",
# "person.address.zip": "10001"
# }
# Batch processing
json_objects = [
'{"a": {"b": 1}}',
'{"c": {"d": 2}}'
]
# Single-threaded batch processing
flattened_batch = flatten_json_batch(json_objects)
# Multi-threaded batch processing (auto thread count)
flattened_batch_mt = flatten_json_batch(json_objects, use_threads=True)
# Multi-threaded batch processing (specific thread count)
flattened_batch_mt_spec = flatten_json_batch(json_objects, use_threads=True, num_threads=4)
from json_alchemy import generate_schema, generate_schema_batch
# Single object schema generation
json_obj_str = '''
{
"name": "John",
"age": 30,
"is_active": true,
"scores": [85, 90, 78],
"address": {
"city": "New York",
"zip": "10001"
}
}
'''
schema = generate_schema(json_obj_str)
print(schema)
# Output:
# {
# "type": "object",
# "properties": {
# "name": {"type": "string"},
# "age": {"type": "integer"},
# "is_active": {"type": "boolean"},
# "scores": {
# "type": "array",
# "items": {"type": "integer"}
# },
# "address": {
# "type": "object",
# "properties": {
# "city": {"type": "string"},
# "zip": {"type": "string"}
# }
# }
# }
# }
# Batch processing
json_objects = [
'{"a": 1, "b": "string"}',
'{"a": 2, "c": true}'
]
# Single-threaded batch processing
schema_batch = generate_schema_batch(json_objects)
# Multi-threaded batch processing (auto thread count)
schema_batch_mt = generate_schema_batch(json_objects, use_threads=True)
# Multi-threaded batch processing (specific thread count)
schema_batch_mt_spec = generate_schema_batch(json_objects, use_threads=True, num_threads=4)
Based on our benchmarks:
Batch Processing:
Multi-threading:
Optimal Batch Size:
# Clone the repository
git clone https://github.com/amaye15/AIMv2-rs.git
cd AIMv2-rs/python
# Install the package in development mode
pip install -e .
If you encounter any issues during installation, please refer to the INSTALL.md file for troubleshooting.
MIT License
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.3.3 | 23 May 2025 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 11:25 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:fb5c35b473b233f996ada3caff18a924071ff165c15ae79838de9df2db567c8d