Registry / devops / json-normalize

json-normalize

JSON →
library1.1.0pypypi✓ verified 79d ago

Recursively flattens JSON-like structures into a list of flat dictionaries. Version 1.1.0 is available with no required Python version specified. Release cadence is low; major changes are infrequent.

pip install json-normalize
INSTALL
IMPORT
SIG · JSON-NORMALIZE
J
json-normalize
devopspythonv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

json_normalize
from json_normalize import json_normalize
from json_normalize import Normalizer

Instantiate Normalizer and call normalize() on a dict or list of dicts.

from json_normalize import Normalizer import json data = {"id": 1, "name": "John", "address": {"city": "NYC", "zip": 10001}} normalizer = Normalizer() result = normalizer.normalize(data) print(json.dumps(result, indent=2))
Debug
Known issues
gotchaNormalizer mutates the input data by default. Pass `copy=True` to avoid side effects.
fix
Use `Normalizer(copy=True).normalize(data)`
affects: all
deprecatedThe `flatten` function from earlier versions is deprecated in favor of `Normalizer` class.
fix
Replace `from json_normalize import flatten` with `from json_normalize import Normalizer`
affects: <1.0.0
gotchaArrays inside objects are flattened into separate rows by default. This can cause unexpected row duplication.
fix
Set `max_level=1` or use `recurse=False` to limit recursion.
affects: all
Upgrade
Version history
1.1.0latest on PyPI · released Mar 28, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
json-normalize — pip install json-normalize · libregistry