A tool for exploring and analyzing JSON structure with aggregated statistics
Project description
JSON Profiler
A Python tool for exploring and analyzing JSON structure with aggregated statistics. This package helps you understand the structure of complex JSON data by providing detailed insights into field types, presence percentages, and nested structures.
Installation
pip install json-profiler
Usage
from json_profiler import explore_json_aggregated
import json
# Example JSON data
data = {
"users": [
{"id": 1, "name": "Alice", "email": "alice@example.com", "tags": ["admin", "user"]},
{"id": 2, "name": "Bob", "email": "bob@example.com", "tags": []},
{"id": 3, "name": "Charlie", "tags": ["user"]}
],
"metadata": {
"total": 3,
"active": True
}
}
# Analyze the JSON structure
result = explore_json_aggregated(data)
This will output:
=== AGGREGATED STRUCTURE ===
users[] (total items: 3 across 1 list instances):
email: str (66.7% present)
id: int (100.0% present)
name: str (100.0% present)
tags: list (100.0% present) [WARNING: 1/3 lists empty (33.3%)]
ROOT[] (total items: 1 across 1 list instances):
active: bool (100.0% present)
total: int (100.0% present)
Features
- Field Analysis: Shows data types and presence percentages for each field
- Nested Structure Support: Handles deeply nested JSON objects and arrays
- Empty List Detection: Warns about empty lists in your data
- Aggregated Statistics: Provides comprehensive statistics across all instances
- Type Information: Shows all data types encountered for each field
Return Value
The function returns a dictionary containing all unique values found for each field across the entire JSON structure.
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file json_profiler-0.1.0.tar.gz.
File metadata
- Download URL: json_profiler-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c543779510ff55136f02fc931c3d895ffbc2767e285d232989145f2a68134bc3
|
|
| MD5 |
a4d2046aba62a89ca38992486016dc96
|
|
| BLAKE2b-256 |
53a5dc2db7b7bddeac63b28c24986e5bc4f15b475304ec49aa7603bb1afd3172
|
File details
Details for the file json_profiler-0.1.0-py3-none-any.whl.
File metadata
- Download URL: json_profiler-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
716ffd1de51327ffecfd674a8b130af7a2ed9771cafd9409dcfc2a6c0b75762e
|
|
| MD5 |
60462602eb230c22c0b152a67100b3a1
|
|
| BLAKE2b-256 |
843d534bd51ea1115e13608f7d9e2dcc0ee554608b1f4304d0684d395456d78e
|