Metadata-Version: 2.4
Name: fly_ruler_proto_python
Version: 0.4.0
Summary: Python client and PyO3 bindings for the FlyRuler protobuf/UDP protocol
Author-email: windlx <1418043337@qq.com>
Requires-Python: >=3.12
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# fly_ruler_proto_python

`fly_ruler_proto_python` 是 FlyRuler 协议的 Python 绑定。Rust 侧 `_core`（PyO3）提供协议类型与 UDP 客户端，Python 侧提供 `FlyRulerClient` 等高层封装，并附带一个命令行自检入口。要求 Python 3.12+。

## 目录结构

- `src/lib.rs`、`src/client.rs`、`src/protocol.rs` —— PyO3 扩展 `fly_ruler_proto_python._core`（`crate-type = cdylib`）。
- `src/fly_ruler_proto_python/` —— 纯 Python 包：`__init__.py`（导出面与 `main()`）、`client.py`（`FlyRulerClient`、`create_aircraft_state`）、`_core.pyi`（类型存根）。
- `examples/` —— 从连接到多机编队的渐进示例，见 `examples/README.md`。
- `tests/` —— pytest 回归。

## 安装与运行

- 同步依赖：`uv sync --all-groups`。
- 本地安装扩展：`uv run maturin develop`。
- 自检：`uv run fly_ruler_proto_python`，打印协议版本与公开导出面。

## 测试

- `uv run pytest tests/`（需先构建扩展）。
- 仓库入口：`just check`、`just test`（后者会先跑 `maturin develop`）。

