# PolyConf
## Credit
The `polyconf.core.deepmerge` module is a heavy refactor of [gh://toumorokoshi/deepmerge](https://github.com/toumorokoshi/deepmerge).
(More specifically, I based it on the tip of `main` at the time, which was commit `33a078ac7a29b63dfb91fea806cc6b96ede3fd23`.)
I don't want this library to have 3rd party dependencies, so I basically stripped the dynamic configurability of `deepmerge`,
such that the behavior of `always_merge()` became the _only_ behavior.
The keyword arguments are quite self-explanatory, so to concisely define the behavior, consider this snippet:
```python
always_merger = Merger(
type_strategies=[
(list, "append"),
(dict, "merge"),
(set, "union"),
],
fallback_strategies=["override"],
type_conflict_strategies=["override"],
)
```
The refactor is _heavy_, indeed. At the time of this writing, `cloc` calculates it at only `22` lines of code.
However, I still want to give credit where it's due because there are a couple lessons in recursion
and fallback behavior that would have been painful to work out myself.
It also serves as a reminder for future reference because if I ever reverse the moratorium on 3rd party libs,
I'll happily depend on `deepmerge` directly.
<!-- github-only -->
Raw data
{
"_id": null,
"home_page": "https://polyconf.readthedocs.io",
"name": "polyconf",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11,<4.0",
"maintainer_email": "",
"keywords": "polyconf,configuration",
"author": "Jesse Butcher",
"author_email": "boweeb@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/dc/54/4debc403da0579ca600f6466a2a4bd21dd919d669591589c40e7d9b9cb19/polyconf-0.2.0.tar.gz",
"platform": null,
"description": "# PolyConf\n\n## Credit\n\nThe `polyconf.core.deepmerge` module is a heavy refactor of [gh://toumorokoshi/deepmerge](https://github.com/toumorokoshi/deepmerge).\n(More specifically, I based it on the tip of `main` at the time, which was commit `33a078ac7a29b63dfb91fea806cc6b96ede3fd23`.)\nI don't want this library to have 3rd party dependencies, so I basically stripped the dynamic configurability of `deepmerge`,\nsuch that the behavior of `always_merge()` became the _only_ behavior.\n\nThe keyword arguments are quite self-explanatory, so to concisely define the behavior, consider this snippet:\n\n```python\nalways_merger = Merger(\n type_strategies=[\n (list, \"append\"),\n (dict, \"merge\"),\n (set, \"union\"),\n ],\n fallback_strategies=[\"override\"],\n type_conflict_strategies=[\"override\"],\n)\n```\n\nThe refactor is _heavy_, indeed. At the time of this writing, `cloc` calculates it at only `22` lines of code.\nHowever, I still want to give credit where it's due because there are a couple lessons in recursion\nand fallback behavior that would have been painful to work out myself.\nIt also serves as a reminder for future reference because if I ever reverse the moratorium on 3rd party libs,\nI'll happily depend on `deepmerge` directly.\n\n<!-- github-only -->\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Gather and merge configuration from many sources.",
"version": "0.2.0",
"project_urls": {
"Documentation": "https://polyconf.readthedocs.io",
"Homepage": "https://polyconf.readthedocs.io",
"Repository": "https://github.com/boweeb/polyconf"
},
"split_keywords": [
"polyconf",
"configuration"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ef4436ef019e3ced66379f7e973dffcb5e97002137bc50fabd4d9b2da53db9af",
"md5": "9eb97604363a9352d2520af9f6a143e3",
"sha256": "1f9f9c471790620b18a824b9189f717e7f8014b8b25f399a3e46e63bcc0eee22"
},
"downloads": -1,
"filename": "polyconf-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9eb97604363a9352d2520af9f6a143e3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11,<4.0",
"size": 17678,
"upload_time": "2023-07-29T16:27:17",
"upload_time_iso_8601": "2023-07-29T16:27:17.829758Z",
"url": "https://files.pythonhosted.org/packages/ef/44/36ef019e3ced66379f7e973dffcb5e97002137bc50fabd4d9b2da53db9af/polyconf-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dc544debc403da0579ca600f6466a2a4bd21dd919d669591589c40e7d9b9cb19",
"md5": "18f6d885b3edc57bcf325e98f74ce24b",
"sha256": "bd640a8b43befd7e8673df412150ff0559224ff184b4cc171ce2f8628d5a52af"
},
"downloads": -1,
"filename": "polyconf-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "18f6d885b3edc57bcf325e98f74ce24b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11,<4.0",
"size": 18824,
"upload_time": "2023-07-29T16:27:18",
"upload_time_iso_8601": "2023-07-29T16:27:18.851336Z",
"url": "https://files.pythonhosted.org/packages/dc/54/4debc403da0579ca600f6466a2a4bd21dd919d669591589c40e7d9b9cb19/polyconf-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-29 16:27:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "boweeb",
"github_project": "polyconf",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "polyconf"
}