Skip to main content

Efficient JSON flattening for complex nested structures

Project description

jsonxplode Efficient JSON flattening for complex nested structures

Python 3.6+ | MIT License | Zero Dependencies

jsonxplode converts nested JSON structures into flat tabular format while preserving all data, including complex nested arrays and objects with arbitrary depth.

Installation BASH pip install jsonxplode Usage PYTHON from jsonxplode import flatten

Handles any JSON structure

data = { "users": [ {"profile": {"name": "John", "settings": {"theme": "dark"}}}, {"profile": {"name": "Jane", "settings": {"theme": "light"}}} ] }

flattened_data = flatten(data)

Returns: [{'users.profile.name': 'John', 'users.profile.settings.theme': 'dark'},

{'users.profile.name': 'Jane', 'users.profile.settings.theme': 'light'}]

Optional: DataFrame Output PYTHON from jsonxplode import to_dataframe

Requires pandas to be installed separately

df = to_dataframe(data) Note: to_dataframe requires pandas (pip install pandas) but the core flatten function has zero dependencies.

Features Arbitrary nesting depth - handles deeply nested objects and arrays Conflict resolution - automatically manages key path conflicts Memory efficient - processes large datasets with minimal overhead Zero dependencies - pure Python implementation (core function) Array expansion - properly handles nested arrays with row duplication Performance 7,900 rows with 23 column processed in 0.146 seconds Memory usage: ~46MB for previously mentioned workload

Project details


Download files

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

Source Distribution

jsonxplode-1.0.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

jsonxplode-1.0.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file jsonxplode-1.0.0.tar.gz.

File metadata

  • Download URL: jsonxplode-1.0.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for jsonxplode-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7ce1746314c4d5d1a83480c1df1c15cee428c45a6e835ab40468f46144587af1
MD5 e5934d02870e77129b070d36c989cf17
BLAKE2b-256 db89c58f8778f2af5657a1e5f5a0652d6974179f19089f0b2d8cd80f3a558609

See more details on using hashes here.

File details

Details for the file jsonxplode-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: jsonxplode-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for jsonxplode-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cfa03ca25a7cb463a06db186884120987af7cf9189ed2a3280c4ae07a477efd0
MD5 5152b7d7b6d862f57ad3041414cda6ce
BLAKE2b-256 1d5a1014e5d4d0b4ec8bb1e561bb54f70ab36b62bfdc9b18ecd0090332a3a98f

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