diff --git a/README.md b/README.md index 3858733..9952543 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,25 @@ English / [日本語](https://github.com/Moge800/gomc_rest_python/blob/main/README_JP.md) -Python package for talking to Mitsubishi PLCs via -[gomc-rest](https://github.com/Moge800/gomc-rest) — **Pattern B**: the -`gomc-rest` server binary is bundled and auto-launched as a subprocess, so you -never have to start or distribute the executable yourself. +**A Python library for talking to Mitsubishi PLCs.** Read and write PLC devices +over the MC protocol (3E/4E frames) — the protocol is handled for you by a bundled +[gomc-rest](https://github.com/Moge800/gomc-rest) server that the package +auto-launches, so you never have to start or distribute an executable yourself. -The HTTP layer is provided by +**Bonus — expose a REST API.** Enable `server_mode` to make the bundled +server's REST API reachable from other apps on your network (a GUI, another +machine, another language); and `connect()` talks to a gomc-rest server that is +already running elsewhere. See [Access control](#access-control). + +Under the hood the HTTP layer is provided by [gomc-rest-client](https://github.com/Moge800/gomc_rest_client); this package -adds only the bundled binary and its process lifecycle. +adds the bundled binary and its process lifecycle. ```text your Python process └─ gomc_rest.launch() - ├─ spawns gomc-rest (bundled exe) on a free loopback port ── MC protocol ──▶ PLC - └─ returns a gomc_rest_client.PLCClient pointed at it + ├─ spawns the bundled gomc-rest on a free loopback port ── MC protocol ──▶ PLC + └─ returns a Server that provides a PLCClient pointed at it ``` ## Install diff --git a/README_JP.md b/README_JP.md index 72e91c2..ac8cab6 100644 --- a/README_JP.md +++ b/README_JP.md @@ -2,12 +2,19 @@ [English](README.md) / 日本語 -三菱PLCと通信するためのPythonパッケージです。 -[gomc-rest](https://github.com/Moge800/gomc-rest) のサーバーバイナリを同梱し、 -子プロセスとして自動起動する「サーバー同梱型(Pattern B)」を採用しています。 -利用者がサーバーの実行ファイルを別途用意したり、手動で起動したりする必要はありません。 - -HTTPクライアント機能には +**三菱PLCと通信するためのPythonライブラリです。** MCプロトコル(3E/4Eフレーム)で +PLCのデバイスを読み書きできます。MCプロトコル通信は同梱の +[gomc-rest](https://github.com/Moge800/gomc-rest) サーバーが処理するため、 +利用者がサーバーの実行ファイルを別途用意したり、手動で起動したりする +必要はありません。 + +**追加機能 — REST APIのネットワーク公開。** `server_mode` を有効にすると、 +同梱サーバーのREST APIをネットワークから利用可能にし、他のアプリケーション +(GUI、別のコンピューター、別の言語のクライアントなど)から呼び出せます。また +`connect()` を使えば、すでに別の場所で稼働している gomc-rest へ +クライアントとして接続できます(「アクセス制御」を参照)。 + +内部のHTTPクライアント機能には [gomc-rest-client](https://github.com/Moge800/gomc_rest_client) を使用しています。 このパッケージが追加するのは、サーバーバイナリの同梱とプロセスの ライフサイクル管理です。 diff --git a/pyproject.toml b/pyproject.toml index 0444bd7..7e48e31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "hatchling.build" [project] name = "gomc-rest" version = "0.1.0" -description = "Pattern-B wrapper for gomc-rest: bundles the gomc-rest server binary and auto-launches it, exposing a Python client for Mitsubishi PLCs." +description = "Talk to Mitsubishi PLCs from Python over the MC protocol via a bundled, auto-launched gomc-rest server — with optional REST API exposure." readme = "README.md" requires-python = ">=3.10" license = { text = "MIT" }