Metadata-Version: 2.5
Name: godlib
Version: 0.0.2
Summary: Recursive dict merge with explicit list handling.
Project-URL: Homepage, https://github.com/lqxnjk/godlib
Author: lqxnjk
License: MIT
License-File: LICENSE
Keywords: config,deep,dict,merge,nested
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# godlib

Recursive merge for nested dictionaries. Config files layered over defaults is
the usual reason to need this.

## Install

```console
pip install godlib
```

## Usage

```python
from godlib import deep_merge, ListMode

base = {"db": {"host": "localhost", "port": 5432}, "tags": ["a"]}
over = {"db": {"port": 6543}, "tags": ["b"]}

deep_merge(base, over)
# {'db': {'host': 'localhost', 'port': 6543}, 'tags': ['b']}

deep_merge(base, over, n_list=ListMode.APPEND)
# {'db': {'host': 'localhost', 'port': 6543}, 'tags': ['a', 'b']}
```

## Behaviour

| Case | Result |
| --- | --- |
| both sides dict | merged recursively |
| both sides list | depends on `n_list` |
| anything else | value from the override wins |
| key only in base | kept |
| key only in override | added |

Inputs are deep-copied, never mutated.

## License

MIT
