Metadata-Version: 2.5
Name: godlib
Version: 0.0.4
Summary: 嵌套字典递归合并，可选列表拼接策略。
Project-URL: Homepage, https://pypi.org/project/godlib/
Author-email: lqxnjk <lqxnjk@qq.com>
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

[English](#english) | 中文

嵌套字典递归合并，可选列表拼接策略。

## 安装

```console
pip install godlib
```

## 用法

```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']}
decode = deep_merge(base, over, n_list=ListMode.APPEND)
# {'db': {...}, 'tags': ['a', 'b']}
```

## 说明

两边都是 dict 时递归合并，其余类型由覆盖值胜出；`n_list` 决定列表是替换、追加还是前置；入参全程深拷贝，不会改动调用方的对象。

## 许可证

MIT

---

<a id="english"></a>
## English

Recursive dict merge with explicit list handling.

## 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']}
decode = deep_merge(base, over, n_list=ListMode.APPEND)
# {'db': {...}, 'tags': ['a', 'b']}
```

## Notes

Nested dicts merge recursively; every other type is taken from the override. `n_list` decides whether lists replace, append or prepend. Inputs are deep-copied, never mutated.

## License

MIT
