Skip to main content

MSXシリアルターミナル

Project description

MSXシリアルターミナル

CI PyPI version

MSXとのシリアル通信またはtelnet接続を行うターミナルプログラムです。日本語文字の送受信やファイル転送機能を備えています。

インストール

pip install msx-serial

使い方

基本的な使い方

# シリアル接続
msx-serial COM1
msx-serial /dev/ttyUSB0
msx-serial /dev/tty.usbserial-12345678901
msx-serial 'serial:///dev/tty.usbserial-12345678901?baudrate=115200'

# Telnet接続
msx-serial 192.168.86.30:2223
msx-serial telnet://192.168.86.30:2223

コマンドラインオプション

usage: msx-serial [-h] [--encoding ENCODING] connection

MSXシリアルターミナル

positional arguments:
  connection           接続先 (例: COM1, /dev/ttyUSB0, 192.168.1.100:2223, telnet://192.168.1.100:2223, serial:///COM1?baudrate=9600)

options:
  -h, --help           ヘルプメッセージを表示して終了
  --encoding ENCODING  エンコーディング (デフォルト: msx-jp)

特殊コマンド

  • @paste: テキストファイルを読み込んで貼り付け
  • @upload: ファイルをアップロード
  • @cd: カレントディレクトリを変更
  • @encode: 送受信時の文字コードを指定(msx-jp, msx-intl, msx-br, shift-jis)
  • @help: コマンドのヘルプを表示
  • @exit: プログラムを終了

特殊コマンドの詳細な使用方法は @help コマンドで確認できます。

主な機能

  • MSXとのシリアル通信
  • 日本語文字の送受信(MSX文字コード対応)
  • ファイル送信機能
  • コマンド補完機能
  • カラー表示

文字コード対応

  • UTF-8からMSX文字コードへの変換
  • MSX文字コードからUTF-8への変換
  • グラフィックキャラクタ対応
  • 濁点・半濁点対応

開発者向け情報

必要条件

  • Python 3.9以上
  • 必要なパッケージ(pyproject.tomlに記載)

開発環境のセットアップ

# リポジトリのクローン
git clone https://github.com/yamamo-to/msx-serial
cd msx-serial

# 仮想環境の作成と有効化
python -m venv venv
.\venv\Scripts\activate  # Windowsの場合
source venv/bin/activate  # Linuxの場合

# 開発モードでインストール
pip install -e . --use-pep517

プロジェクト構造

msx_serial/
├── connection/    # 通信関連のモジュール
├── completion/    # コマンド補完機能
├── data/          # データファイル(文字コード変換テーブルなど)
├── input/         # 入力処理関連
├── transfer/      # ファイル転送機能
├── ui/            # ユーザーインターフェース
└── man/           # マニュアル

主要モジュールの説明

  • connection/: シリアル通信とtelnet接続の実装
  • completion/: コマンド補完機能の実装
  • input/: キー入力処理とコマンド解析
  • transfer/: ファイル転送機能の実装
  • ui/: ターミナルUIの実装
  • data/: 文字コード変換テーブルなどの静的データ

依存関係

  • Python 3.9以上
  • colorama: ターミナルのカラー表示
  • prompt-toolkit: 対話型コマンドラインインターフェース
  • pyserial: シリアル通信
  • PyYAML: YAMLファイルの読み込み
  • chardet: 文字エンコーディングの検出
  • msx-charset: MSX文字コードの変換

謝辞

BASE64によるアップロードは下記の記事を参考にさせていただきました。 https://qiita.com/enu7/items/23cab122141fb8d07c6d

MSX-BASICのコマンドリファレンスは下記のリポジトリをAIによりman形式に変換させていただきました。 https://github.com/fu-sen/MSX-BASIC

ライセンス

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

msx_serial-0.2.12.tar.gz (87.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

msx_serial-0.2.12-py3-none-any.whl (176.9 kB view details)

Uploaded Python 3

File details

Details for the file msx_serial-0.2.12.tar.gz.

File metadata

  • Download URL: msx_serial-0.2.12.tar.gz
  • Upload date:
  • Size: 87.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for msx_serial-0.2.12.tar.gz
Algorithm Hash digest
SHA256 a34cc8153960d6add67a6848350f75c9215b48cf36ad34220235572e16ba1051
MD5 06a89d7fe426c23d1e1bfdc5ea3f8ca0
BLAKE2b-256 d09d803afd98b340f1ca51442e380291f39b42514ada9760ee957f388f8cd31c

See more details on using hashes here.

File details

Details for the file msx_serial-0.2.12-py3-none-any.whl.

File metadata

  • Download URL: msx_serial-0.2.12-py3-none-any.whl
  • Upload date:
  • Size: 176.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for msx_serial-0.2.12-py3-none-any.whl
Algorithm Hash digest
SHA256 6a799e1c3cf0562266ed8333e0c94f73a954221aa9db1ace83e7b469dab71869
MD5 00764c7be65145bb623345a588ffcf6a
BLAKE2b-256 7bcb438c6e197ad1e4187980a2fff6150999a19e6f1ca856c87a0e63d34f987d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page