Metadata-Version: 2.4
Name: lirays
Version: 0.1.2
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: License :: OSI Approved :: MIT License
Classifier: Typing :: Typed
License-File: LICENSE
Summary: Python client for LiRAYS SCADA, backed by the Rust lirays crate
Keywords: scada,industrial,websocket,protobuf,lirays,rust,python
Home-Page: https://github.com/LiRAYSgj/LiRAYS-SCADA-python
Author: LiRAYS
Maintainer: LiRAYS
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/LiRAYSgj/LiRAYS-SCADA-python
Project-URL: Issues, https://github.com/LiRAYSgj/LiRAYS-SCADA-python/issues
Project-URL: Repository, https://github.com/LiRAYSgj/LiRAYS-SCADA-python

# lirays (Python)

Python client for LiRAYS SCADA powered by the Rust [`lirays`](https://crates.io/crates/lirays) crate.

- PyPI: [pypi.org/project/lirays](https://pypi.org/project/lirays/)
- Rust core: [crates.io/crates/lirays](https://crates.io/crates/lirays)

## Features

- Same high-level API surface as the Rust client.
- Connect with or without PAT auth.
- Namespace operations: list, create, delete, metadata edit.
- Value operations: get/set for integer, float, text, and boolean.
- Bulk creation from JSON schema.
- Realtime subscription stream for variable values.
- Optional insecure TLS mode for local self-signed certificates.

## Installation

```bash
pip install lirays
```

## Quick Start

```python
from lirays import Client, ConnectionOptions, FloatVar

opts = ConnectionOptions("127.0.0.1", 8245, tls=False, pat_token=None)
client = Client.connect_with_options(opts)

client.create_folders(["demo"], timeout_ms=8000)
client.create_float_variables([FloatVar(name="signal")], parent_id="/demo", timeout_ms=8000)
print(client.get_values(["/demo/signal"], timeout_ms=8000))

client.disconnect()
```

## Self-signed TLS (local/dev only)

```python
from lirays import ConnectionOptions, Client

opts = ConnectionOptions("127.0.0.1", 8245, tls=True, allow_insecure_tls=True)
client = Client.connect_with_options(opts)
```

## Development

```bash
python -m pip install --upgrade pip maturin pytest
maturin develop
pytest -q
```

## Demo Scenarios

Demo scripts are under [`demo/`](demo/README.md) and mirror the Rust demos:

- `basic`
- `bulk`
- `subscribe`
- `tree_stress`
- `data_stress`
- `all`

## Release

Push a tag like `v0.1.0` to trigger GitHub Actions publishing to PyPI via Trusted Publishing (OIDC).

## License

MIT ([LICENSE](LICENSE)).

