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.11.tar.gz (85.9 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.11-py3-none-any.whl (175.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: msx_serial-0.2.11.tar.gz
  • Upload date:
  • Size: 85.9 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.11.tar.gz
Algorithm Hash digest
SHA256 fe7613dfa6079c01be90b60d8d9e86bec851cf39a18c678b2b6567ca53f3621e
MD5 b0473a17d0fab7e623ec0b4ba0e9b62c
BLAKE2b-256 2eddf274b4e13d70029176b9e0f4c569f082abe8e7f521499d4b3d9b8c730618

See more details on using hashes here.

File details

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

File metadata

  • Download URL: msx_serial-0.2.11-py3-none-any.whl
  • Upload date:
  • Size: 175.4 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.11-py3-none-any.whl
Algorithm Hash digest
SHA256 573744606ccc86f339a33a916365be7331e520ff3a4cd541e4c65beb1d96f1bc
MD5 83d24df222b5415f8a7da70c2a307b45
BLAKE2b-256 ad7b261b0738aac438be8c9d0d8a39f85a3a54d195e529f58432752bf4411db1

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