Metadata-Version: 2.4
Name: pyglaze
Version: 1.0.0
Summary: Pyglaze is a library used to operate the devices of Glaze Technologies
Author: GLAZE Technologies ApS
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://www.glazetech.dk/
Project-URL: Documentation, https://glazetech.github.io/pyglaze/latest
Project-URL: Repository, https://github.com/GlazeTech/pyglaze
Project-URL: Issues, https://github.com/GlazeTech/pyglaze/issues
Requires-Python: <3.15,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=2.0.0
Requires-Dist: pyserial>=3.5
Requires-Dist: scipy>=1.7.3
Requires-Dist: typing_extensions>=4.12.2
Requires-Dist: protobuf>=6.33.0
Requires-Dist: cobs>=1.2.1
Requires-Dist: crccheck>=1.3.1
Requires-Dist: semver<4,>=3.0.4
Provides-Extra: build
Requires-Dist: build>=1.2.1; extra == "build"
Requires-Dist: twine>=5.1.1; extra == "build"
Requires-Dist: bumpver>=2023.1129; extra == "build"
Provides-Extra: test
Requires-Dist: pytest>=9.0.3; extra == "test"
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.2.3; extra == "docs"
Requires-Dist: mkdocs-material>=8.2.5; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.18.1; extra == "docs"
Requires-Dist: mike>=1.1.2; extra == "docs"
Requires-Dist: Pygments>=2.20.0; extra == "docs"
Requires-Dist: bumpver>=2023.1129; extra == "docs"
Provides-Extra: dev
Requires-Dist: ruff>=0.14.10; extra == "dev"
Requires-Dist: ty>=0.0.13; extra == "dev"
Requires-Dist: pytest>=9.0.3; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: semver>=2.13.0; extra == "dev"
Requires-Dist: types-pyserial>=3.5.0.8; extra == "dev"
Requires-Dist: types-protobuf>=6.32.1; extra == "dev"
Requires-Dist: bumpver>=2023.1129; extra == "dev"
Dynamic: license-file

# Pyglaze
Pyglaze is a python library used to operate the devices of [Glaze Technologies](https://www.glazetech.dk/).

Documentation can be found [here](https://glazetech.github.io/pyglaze/latest/).

# Installation

To install the latest version of the package, simply run 

```
pip install pyglaze
```

# Usage 
See [our documentation](https://glazetech.github.io/pyglaze/latest/) for usage.

`pyglaze` expects device firmware that reports MimLink
`operational_state` and `config_status_reason`. Devices that omit those
fields are unsupported.

## Firmware Updates

Pyglaze supports firmware updates over MimLink via `FirmwareUpdater`.

- Guide: [Firmware Updates](https://glazetech.github.io/pyglaze/latest/firmware_update/)
- API: `pyglaze.device.FirmwareUpdater`

Note: `pyglaze` expects a pre-signed MCUboot image and does not sign firmware itself.

# Developers

To install the API with development tools, first clone the repository from our [public GitHub repository](https://github.com/GlazeTech/pyglaze). Then, from the root of the project, run

```
uv sync --extra dev --group security --frozen
```

Run commands through `uv run` so they use the locked environment:

```bash
uv run --frozen pytest
uv run --frozen ruff check .
uv run --group security --frozen pip-audit --strict
```

## Documentation - local build
To build and serve the documentation locally

1. Checkout the repository (or a specific version)
2. Run `uv sync --extra docs --frozen`
3. Run `uv run --frozen mkdocs serve` while standing in the project root.


## MimLink protocol schema sync

> Most developers do not need this. The generated `envelope_pb2.py` is committed
> to the repository. This section is only relevant when syncing `envelope.proto`
> from the upstream MimLink repo.

`pyglaze` vendors the MimLink protobuf schema in
`src/pyglaze/mimlink/proto/envelope.proto`. Python codegen is handled by
[buf](https://buf.build/docs/cli/installation/), which must be installed
separately (e.g. `brew install bufbuild/buf/buf`). Code generation uses
buf remote plugins (pinned in `buf.gen.yaml`), so no local `protoc`
install is required.

When syncing with upstream MimLink:

1. Replace `src/pyglaze/mimlink/proto/envelope.proto` from upstream.
2. Run `./scripts/generate_mimlink_proto.sh`.
3. Commit the updated `envelope_pb2.py`.
4. Run protocol tests: `uv run pytest tests/mimlink/`.


# Bug reporting or feature requests
Please create an issue [here](https://github.com/GlazeTech/pyglaze/issues) and we will look at it ASAP!
