Metadata-Version: 2.4
Name: philiprehberger-flatten-json
Version: 0.1.1
Summary: Flatten nested JSON/dicts into dot-notation keys and unflatten back
Project-URL: Homepage, https://github.com/philiprehberger/py-flatten-json#readme
Project-URL: Repository, https://github.com/philiprehberger/py-flatten-json
Project-URL: Issues, https://github.com/philiprehberger/py-flatten-json/issues
Project-URL: Changelog, https://github.com/philiprehberger/py-flatten-json/blob/main/CHANGELOG.md
Author: Philip Rehberger
License-Expression: MIT
License-File: LICENSE
Keywords: dot-notation,flatten,json,nested,unflatten
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# philiprehberger-flatten-json

Flatten nested JSON/dicts into dot-notation keys and unflatten back.

## Installation

```bash
pip install philiprehberger-flatten-json
```

## Usage

```python
from philiprehberger_flatten_json import flatten, unflatten

nested = {"a": {"b": {"c": 1}}, "d": [2, 3]}

flatten(nested)
# {"a.b.c": 1, "d.0": 2, "d.1": 3}

unflatten({"a.b.c": 1, "d.0": 2, "d.1": 3})
# {"a": {"b": {"c": 1}}, "d": [2, 3]}

# Custom separator
flatten(nested, separator="/")
# {"a/b/c": 1, "d/0": 2, "d/1": 3}

# Max depth
flatten(nested, max_depth=1)
# {"a": {"b": {"c": 1}}, "d": [2, 3]}
```

## API

- `flatten(data, separator=".", max_depth=0)` — Flatten nested structure
- `unflatten(data, separator=".")` — Restore nested structure

## License

MIT
