Python functions for flattening a JSON object to a single dictionary of pairs, and unflattening that dictionary back to a JSON object
Project description
json-flatten
Python functions for flattening a JSON object to a single dictionary of pairs, and unflattening that dictionary back to a JSON object.
Useful if you need to represent a JSON object using a regular HTML form or transmit it as a set of querystring parameters.
For example:
>>> json_flatten.flatten({"foo": {"bar": [1, True, None]}})
{'foo.bar.0$int': '1', 'foo.bar.1$bool': 'True', 'foo.bar.2$none': 'None'}
>>> json_flatten.unflatten(d)
{'foo': {'bar': [1, True, None]}}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for json_flatten-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1449c37729b312084a87ecc40d1bafb0703a6c56424c6770ab08199234c08506 |
|
MD5 | 281aceefcb1cf63725f65eb71c1009e4 |
|
BLAKE2b-256 | 1e8be1e6f8c7de23ff602ca304714f03893cfd92fb052ee56043c0c4608355c9 |