Metadata-Version: 2.4
Name: termora
Version: 0.80.0
Summary: Desktop workbench for serial, CAN, and protocol debugging
Author-email: sunyd168 <sunyd168@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/syd168/Termora
Project-URL: Repository, https://github.com/syd168/Termora
Project-URL: Issues, https://github.com/syd168/Termora/issues
Keywords: serial,uart,can,modbus,terminal,pyside6,protocol
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: System :: Hardware
Classifier: Topic :: Terminals :: Serial
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PySide6>=6.6
Requires-Dist: PySide6-Addons>=6.6
Requires-Dist: python-can>=4.3
Requires-Dist: cantools>=39.0
Dynamic: license-file

# Termora

[![PyPI](https://img.shields.io/pypi/v/termora.svg)](https://pypi.org/project/termora/)
[![Python](https://img.shields.io/pypi/pyversions/termora.svg)](https://pypi.org/project/termora/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Desktop workbench for **serial**, **CAN**, and **protocol** debugging. Built with PySide6, laid out for wide / 2K / 4K screens, with skins and English / 简体中文. Inspired by classic [CuteCom](https://gitlab.com/cutecom/cutecom).

The product name is **Termora**. The Python import package stays `cutecom` so existing macros and scripts keep working.

面向串口、CAN 与协议调试的桌面工作台。基于 PySide6，界面按大屏设计，支持皮肤与多语言。

---

## Install

```bash
pip install termora
termora
```

Or from this repository:

```bash
git clone https://github.com/syd168/Termora.git
cd Termora
python3 -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
pip install -e .
termora
```

Use a **dedicated venv**. Mixing conda `pyside6` with pip `PySide6-Addons` leads to
`libshiboken6.abi3.so` import errors.

### Platform notes

| Capability | Linux | macOS | Windows |
|------------|:-----:|:-----:|:-------:|
| Serial I/O, sessions, macros, plugins | ✓ | ✓ | ✓ |
| CAN (virtual / PCAN / Kvaser / Vector / SLCAN, …) | ✓ | ✓* | ✓* |
| Native SocketCAN | ✓ | — | — |
| X/Y/Zmodem (`sz` / lrzsz) | ✓ | ✓* | — |

\* Needs the matching driver or Homebrew tool. Use the `virtual` CAN backend without hardware.

- **Linux**: `sudo usermod -aG dialout $USER` then log in again.
- **macOS**: ports look like `/dev/cu.*`. Zmodem: `brew install lrzsz`.
- **Windows**: `COMx` in Device Manager. No X/Y/Zmodem (`sz` + POSIX redirection).

---

## Usage

```bash
termora                         # GUI
termora -s Default              # named session
python -m cutecom               # same entry point
python run.py                   # from a source checkout
```

Headless serial (no window; RX on stdout):

```bash
termora --headless --port /dev/ttyUSB0 --baud 115200 --send "AT" --timeout 2
```

| Flag | Meaning |
|------|---------|
| `-s`, `--session` | Open a named session |
| `--port` | Serial device |
| `--baud` | Baud rate (default `115200`) |
| `--send` | String to write after open |
| `--send-file` | File bytes to write after open |
| `--line-end` | `none` / `lf` / `cr` / `crlf` (headless `--send`) |
| `--timeout` | Headless read duration in seconds |
| `--headless` | No GUI; requires `--port` |

Logs: repo runs write `logs/` in the project; a pip-installed run uses the OS app-data directory.

---

## Interface

Connection settings on the left, a large output pane in the middle, command history above, input bar at the bottom.

- **View → Skin**: Light / Dark / Nord / Terminal green
- **View → Language**: English / 简体中文
- **View → Connection settings** (`Alt+S`): reopen the sidebar

---

## Features

Aligned with classic CuteCom:

- Open/close, baud, data bits, parity, stop bits, flow control, RTS/DTR
- Read-write / read-only / write-only, auto-reconnect
- Line endings LF / CR / CRLF / none / Hex, character delay
- Command history, completion, Ctrl control characters
- Text / HEX display, control characters, timestamps, find (`F3`)
- Session manager; disk logs (per session and window)
- Send file as text or script; X/Y/Zmodem on Linux/macOS (`sz`)
- Plugins: macro packs (JSON, hand-editable; legacy `.tmf` supported), UDP/TCP proxy, byte counter, Modbus assistant

Termora extras:

- Skins and language switch
- Local echo (TX in green)
- Leave port settings unchanged on open
- Break, repeat send
- Freeze scroll / export output (`Ctrl+E`)
- Live RX/TX B/s, recent devices
- CRC / checksum tools, protocol pane (NMEA / AT / Modbus)
- CAN analyzer (multiple backends, DBC, sequenced send)
- Widescreen sidebar layout
- Multiple windows (each with its own port and log file)

### Macro packs

JSON files. Built-in examples live in the package (`cutecom/resources/macros/`). When you run from the repo, user copies go under `config/macros/`.

```json
{
  "format": "cutecom-macros",
  "version": 2,
  "name": { "en": "ESP32 / ESP-AT", "zh_CN": "ESP32 / ESP-AT" },
  "macros": [
    { "name": { "en": "Reset", "zh_CN": "复位" }, "command": "AT+RST" }
  ]
}
```

Escapes in commands: `\n` `\r` `\t` `\0` `\xFF`. In JSON write `\\`.

---

## 中文

```bash
pip install termora
termora
```

从源码：

```bash
git clone https://github.com/syd168/Termora.git
cd Termora
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
termora
```

请使用项目自己的虚拟环境。不要用混装了 conda `pyside6` 与 pip `PySide6-Addons` 的解释器，否则会报找不到 `libshiboken6.abi3.so`。

无界面发串口：

```bash
termora --headless --port /dev/ttyUSB0 --baud 115200 --send "AT" --timeout 2
```

Linux 串口权限：`sudo usermod -aG dialout $USER`，重新登录后生效。开发态日志在项目 `logs/`；`pip install` 后使用系统 AppData / Application Support。

---

## License

[MIT](LICENSE). Inspired by [CuteCom](https://gitlab.com/cutecom/cutecom); this is an independent Python implementation.
