Metadata-Version: 2.4
Name: scietex.gpiod_service
Version: 1.2.0
Summary: Scietex microservice daemon for GPIO control
Author-email: Anton Bondarenko <bond.anton@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/bond-anton/scietex.gpiod_service
Project-URL: Bug Tracker, https://github.com/bond-anton/scietex.gpiod_service/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: gpiod~=2.5.0; sys_platform == "linux"
Requires-Dist: msgspec>=0.21.1
Requires-Dist: scietex.service[valkey]~=6.2.0
Provides-Extra: dev
Requires-Dist: tox>=4.54.0; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-asyncio; extra == "test"
Provides-Extra: lint
Requires-Dist: ruff; extra == "lint"
Requires-Dist: ty; extra == "lint"
Dynamic: license-file

# scietex.gpiod_service

`scietex.gpiod_service` is a [`scietex.service`](https://github.com/bond-anton/scietex.service)
worker that owns the host's GPIO lines through
[libgpiod](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/) v2.

It requests the lines the API tells it to, keeps them requested, and exposes
their values over Valkey. Configuration is delivered by the API and applied
**live** — changing a line's direction or bias does not restart the worker.

## Install

```bash
pip install scietex.gpiod_service
```

Requires Python 3.13+, Linux, and libgpiod v2 (`gpiod~=2.5.0`).

## Run

```bash
start-gpiod-service --conf-dir /etc/scietex
```

| Flag | Environment | Default |
| --- | --- | --- |
| `--conf-dir` | `SCIETEX_CONFIG_DIR` | auto-resolved (see below) |
| `--service-name` | `SCIETEX_SERVICE_NAME` | `GPIODService` |
| `--logging-level` | `SCIETEX_LOGGING_LEVEL` | `INFO` |

On first run the service creates `<conf-dir>/gpiod/gpiod.yml` with defaults.
With no chips configured it logs `waiting for remote configuration` and keeps
running; the API then delivers the real configuration.

`--service-name` must match the managed service name registered in the API — it
is what discriminates the Valkey config key. Run exactly one worker per
installation.

## Documentation

| Page | Contents |
| --- | --- |
| [Overview](docs/index.md) | What the service does and how it fits together |
| [Configuration](docs/configuration.md) | The `gpio` section schema, `gpiod.yml`, and the 0.1.x incompatibility |
| [Operations](docs/operations.md) | Service name, live re-apply vs restart, telemetry, container access |

## Development

```bash
uv sync --all-extras
uv run tox                    # format, lint, type, py314
uv run tox -e py314           # tests only
```

See [AGENTS.md](AGENTS.md) for repo conventions.

## License

MIT
