Metadata-Version: 2.4
Name: chainway-serial
Version: 0.2.2
Summary: Asynchronous Python library for Chainway UR4 UHF RFID readers over serial and TCP
Keywords: chainway,ur4,uhf,rfid,epc,gen2,serial,tcp,serialx,asyncio,home-assistant
Author: Daan Vervacke
Author-email: Daan Vervacke <daan.vervacke@proton.me>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: System :: Hardware
Classifier: Typing :: Typed
Requires-Dist: serialx>=1.10
Requires-Python: >=3.14
Project-URL: Homepage, https://github.com/DaanVervacke/chainway-serial
Project-URL: Repository, https://github.com/DaanVervacke/chainway-serial
Project-URL: Issues, https://github.com/DaanVervacke/chainway-serial/issues
Project-URL: Changelog, https://github.com/DaanVervacke/chainway-serial/blob/main/CHANGELOG.md
Project-URL: Documentation, https://chainway-serial.readthedocs.io/
Description-Content-Type: text/markdown

# chainway-serial

[![Check](https://github.com/DaanVervacke/chainway-serial/actions/workflows/check.yml/badge.svg)](https://github.com/DaanVervacke/chainway-serial/actions/workflows/check.yml)
[![PyPI version](https://img.shields.io/pypi/v/chainway-serial.svg)](https://pypi.org/project/chainway-serial/)
[![Python versions](https://img.shields.io/pypi/pyversions/chainway-serial.svg)](https://pypi.org/project/chainway-serial/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Unofficial asynchronous Python library to interact with Chainway UR4 fixed UHF RFID readers over RS-232 and TCP, built on [serialx](https://github.com/puddly/serialx). Requires Python >= 3.14.

> Unofficial and reverse-engineered: not endorsed by Chainway, and it may
> break without notice whenever Chainway changes their firmware.

The library has been tested with a UR4 running UHF module firmware 7.40.1 over RS-232 and TCP.

## Install

```bash
uv add chainway-serial
```

## Documentation

The documentation is hosted at
[chainway-serial.readthedocs.io](https://chainway-serial.readthedocs.io/).

## Usage

```python
import asyncio

from chainway_serial import ChainwayClient


async def main() -> None:
    async with ChainwayClient("/dev/ttyUSB0") as client:
        print(await client.get_version())

        async for tag in client.inventory():
            print(tag.epc.hex(), tag.rssi)


asyncio.run(main())
```

`ChainwayClient` takes any serialx URL: a serial device path, or `socket://host:8888` for a reader on the network.

## Development

See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, the gate and the live hardware tests.

```bash
uv sync
uv run python -m scripts.check
```

## License

MIT. See [LICENSE](LICENSE).
