Metadata-Version: 2.5
Name: somestuff-corestuff
Version: 0.1.0
Summary: Shared settings loader for the somestuff packages: pydantic-settings over config.yaml with config.local.yaml overrides from the working directory, plus JSON/dict helpers
Project-URL: Homepage, https://github.com/vroomfondel/somestuff
Project-URL: Repository, https://github.com/vroomfondel/somestuff
Project-URL: Issues, https://github.com/vroomfondel/somestuff/issues
Author-email: Henning Thieß <ht@xomox.cc>
License-File: LICENSE.md
Keywords: configuration,iot,pydantic-settings,yaml
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.13
Requires-Dist: cachetools>=5.5
Requires-Dist: email-validator>=2.2
Requires-Dist: loguru>=0.7.3
Requires-Dist: pydantic-extra-types>=2.10
Requires-Dist: pydantic-settings>=2.10
Requires-Dist: pydantic>=2.11
Requires-Dist: pytz>=2025.1
Requires-Dist: ruamel-yaml>=0.18
Description-Content-Type: text/markdown

# somestuff-corestuff

Shared settings loader for the `somestuff.*` packages that read the repo-wide `config.yaml`
(`ecowittstuff`, `netatmostuff`, `hydromailstuff`, `llmstuff`).

```python
from somestuff.corestuff.config import get_settings, get_timezone, settings

get_settings().mqtt.host      # explicit
settings.mqtt.host            # lazy proxy, same object
```

Nothing is read at import time. The first access loads, in this order of precedence:

| Source                      | Where it is looked for                                                                       |
|-----------------------------|----------------------------------------------------------------------------------------------|
| environment variables       | nested with `__`, e.g. `MQTT__HOST=broker`                                                   |
| `config.local.yaml`         | `SOMESTUFF_CONFIG_LOCAL_PATH`, else `SOMESTUFF_CONFIG_DIR_PATH`, else the CWD, else `/app`   |
| `config.yaml`               | `SOMESTUFF_CONFIG_PATH`, else `SOMESTUFF_CONFIG_DIR_PATH`, else the CWD, else `/app`, else the packaged sample |

`config.local.yaml` carries the secrets and is never part of a distribution; keep it in the directory you start the tool from.
`python3 -m somestuff.corestuff.config` (or `somestuff-config-dump`) prints the effective settings.

`somestuff.corestuff.configure_logging()` installs the shared loguru format and routes stdlib `logging` into it;
`somestuff.corestuff.helper` has the JSON encoder (`ComplexEncoder`) and `update_deep()`.
