Metadata-Version: 2.4
Name: hugpy-settings
Version: 0.1.19
Summary: Shared HTTP-backed settings editor and reports for Hugpy Wrapper and Harness
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: hugpy-resources<0.2,>=0.1.17.25

# hugpy-settings

Hugpy Settings resolves, validates and displays the settings shared by Hugpy clients. Each field has a domain, a storage location and a definition supplied by Hugpy Resources.

## Installation

Install this library in the Python environment of the application that reads or edits settings.

```sh
python -m pip install hugpy-settings
```

## Quick start

Print the effective values for the shared domain, including where each value came from. The report masks secret fields.

```python
from hugpy_settings import local_settings

for name, row in local_settings.report(["shared"]).items():
    print(name, row["value"], row["source"])
```

## Resolution and storage

For local fields, the process environment takes precedence over configured environment files, saved values and term defaults, in that order. `resolve` includes provenance for applications that need the actual values. Use `report` for display.

`HUGPY_SETTINGS_DATABASE` selects a SQLite settings store. Otherwise local values come from the shared profile, normally `~/.config/hugpy/settings.json`. `local_settings.update` validates a change before saving it, and `reset` removes overrides.

## Editors

Hosts can open the terminal panel for the domains they use. The library provides field widgets, validation and reporting for local settings and HTTP-backed Wrapper settings. A box setting is read or changed through the owning worker’s API.

For a local settings editor, pass a list of domains such as `["discovery", "shared"]` to `local_panel.run(screen, domains)`. Sensitive fields carry the same masking policy in the reporting API and editor. The package also records the origin of values loaded from configured environment files so an operator can tell which source to change.
