From fbd7223c1086564c598d53c27a21d78f673a1c72 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 28 Jun 2026 10:59:56 +0000 Subject: [PATCH 1/2] Reframe positioning: a PLC library first, REST publishing as a bonus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lead the READMEs and the PyPI summary with the user-facing value (talk to Mitsubishi PLCs over the MC protocol, handled by the bundled gomc-rest), and present REST exposure / connect() as a bonus. No code or dependency changes — positioning only, to make the package more approachable. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01SQbVkPEprK2ebcjck5ouUy --- README.md | 21 +++++++++++++-------- README_JP.md | 18 ++++++++++++------ pyproject.toml | 2 +- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3858733..a1c6f7f 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 (SLMP) — 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 — REST publishing.** The same bundled server can be exposed to 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 PLCClient pointed at it ``` ## Install diff --git a/README_JP.md b/README_JP.md index 72e91c2..2ad7830 100644 --- a/README_JP.md +++ b/README_JP.md @@ -2,12 +2,18 @@ [English](README.md) / 日本語 -三菱PLCと通信するためのPythonパッケージです。 -[gomc-rest](https://github.com/Moge800/gomc-rest) のサーバーバイナリを同梱し、 -子プロセスとして自動起動する「サーバー同梱型(Pattern B)」を採用しています。 -利用者がサーバーの実行ファイルを別途用意したり、手動で起動したりする必要はありません。 - -HTTPクライアント機能には +**三菱PLCと通信するためのPythonライブラリです。** MCプロトコル(SLMP)で +PLCのデバイスを読み書きできます。プロトコルの面倒は同梱した +[gomc-rest](https://github.com/Moge800/gomc-rest) サーバーが見てくれるので、 +利用者がサーバーの実行ファイルを別途用意したり、手動で起動したりする +必要はありません。 + +**おまけ — REST公開機能。** 同梱サーバーは、ネットワーク上の他アプリ +(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..00ab8ad 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 publishing." readme = "README.md" requires-python = ">=3.10" license = { text = "MIT" } From e8a77e47402620de5e16c715af73c9d0e26fe764 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 29 Jun 2026 11:35:14 +0000 Subject: [PATCH 2/2] Address PR#4 review: precise protocol/return wording, clearer REST framing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Say 'MC protocol (3E/4E frames)' instead of equating it with SLMP. (P2) - Diagram now says launch() returns a Server that provides a PLCClient, not a PLCClient directly. (P2) - Replace the vague 'REST publishing' wording with 'expose a REST API' / 'REST APIのネットワーク公開', and reword the Japanese intro to read as technical prose ('MCプロトコル通信は同梱の gomc-rest サーバーが処理'). (P2) - Match the PyPI summary wording. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01SQbVkPEprK2ebcjck5ouUy --- README.md | 12 ++++++------ README_JP.md | 11 ++++++----- pyproject.toml | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a1c6f7f..9952543 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,14 @@ English / [日本語](https://github.com/Moge800/gomc_rest_python/blob/main/README_JP.md) **A Python library for talking to Mitsubishi PLCs.** Read and write PLC devices -over the MC protocol (SLMP) — the protocol is handled for you by a bundled +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. -**Bonus — REST publishing.** The same bundled server can be exposed to 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). +**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 @@ -20,7 +20,7 @@ adds the bundled binary and its process lifecycle. your Python process └─ gomc_rest.launch() ├─ spawns the bundled gomc-rest on a free loopback port ── MC protocol ──▶ PLC - └─ returns a PLCClient pointed at it + └─ returns a Server that provides a PLCClient pointed at it ``` ## Install diff --git a/README_JP.md b/README_JP.md index 2ad7830..ac8cab6 100644 --- a/README_JP.md +++ b/README_JP.md @@ -2,14 +2,15 @@ [English](README.md) / 日本語 -**三菱PLCと通信するためのPythonライブラリです。** MCプロトコル(SLMP)で -PLCのデバイスを読み書きできます。プロトコルの面倒は同梱した -[gomc-rest](https://github.com/Moge800/gomc-rest) サーバーが見てくれるので、 +**三菱PLCと通信するためのPythonライブラリです。** MCプロトコル(3E/4Eフレーム)で +PLCのデバイスを読み書きできます。MCプロトコル通信は同梱の +[gomc-rest](https://github.com/Moge800/gomc-rest) サーバーが処理するため、 利用者がサーバーの実行ファイルを別途用意したり、手動で起動したりする 必要はありません。 -**おまけ — REST公開機能。** 同梱サーバーは、ネットワーク上の他アプリ -(GUI、別のコンピューター、別の言語など)へ公開することもできます。また +**追加機能 — REST APIのネットワーク公開。** `server_mode` を有効にすると、 +同梱サーバーのREST APIをネットワークから利用可能にし、他のアプリケーション +(GUI、別のコンピューター、別の言語のクライアントなど)から呼び出せます。また `connect()` を使えば、すでに別の場所で稼働している gomc-rest へ クライアントとして接続できます(「アクセス制御」を参照)。 diff --git a/pyproject.toml b/pyproject.toml index 00ab8ad..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 = "Talk to Mitsubishi PLCs from Python over the MC protocol via a bundled, auto-launched gomc-rest server — with optional REST publishing." +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" }