Skip to main content

Pure Python 3 implementation of the X-, Y-, and Z-Modem file transfer protocols

Project description

Yesterwind XYZ-modem

CI PyPI Python Coverage

Pure-Python async implementation of the X-, Y-, and Z-Modem file transfer protocols. No subprocesses, no external tools — everything is implemented in Python 3.9+.

Installation

pip install yesterwind-xyzmodem

Usage

ZModem receive (from any transport)

from yesterwind_xyzmodem.transport import StreamTransport
from yesterwind_xyzmodem.zmodem import ZModem

transport = StreamTransport(reader, writer)
zmodem = ZModem(transport)
received_paths = await zmodem.receive("./downloads")

ZModem send

zmodem = ZModem(transport)
await zmodem.send(["file1.bin", "file2.txt"])

XModem / YModem

from yesterwind_xyzmodem.xmodem import XModem
from yesterwind_xyzmodem.ymodem import YModem

xmodem = XModem(transport)
await xmodem.send("file.bin")
await xmodem.receive("file.bin")

ymodem = YModem(transport)
await ymodem.send(["a.bin", "b.txt"])
paths = await ymodem.receive("./downloads")

Progress callbacks

from yesterwind_xyzmodem.callbacks import EventType

def on_progress(p):
    if p.event == EventType.BLOCK_RECEIVED:
        print(f"{p.filename}: {p.bytes_transferred}/{p.total_bytes}")

zmodem = ZModem(transport, callback=on_progress)

Demos

rz — download via ZModem over TCP

Equivalent to rz --tcp-client, works against sz --tcp-server:

# On the sending machine (using our sz demo):
uv run demos/sz.py myfile.bin
# Prints the port, e.g.: Listening on 0.0.0.0:12345

# Or using the reference implementation:
sz --tcp-server myfile.bin

# On the receiving machine:
uv run demos/rz.py <host> <PORT> [-d download_dir]

sz — ZModem TCP server (send files to any rz client)

Sends one or more files to any connecting ZModem receiver. Mirrors sz --tcp-server. The OS assigns a free port automatically unless you specify one with --port.

# Single-shot: accept one client, send file, exit
uv run demos/sz.py myfile.bin

# Serve forever: keep listening, handle clients in parallel
uv run demos/sz.py --serve-forever -p 12345 file1.bin file2.bin

# Connect with the reference rz or our own client:
rz --tcp-client <host>:12345
uv run demos/rz.py <host> 12345

bbs — telnet BBS client with auto ZModem receive

Connects to any telnet BBS. ZModem transfers are detected automatically and a retro progress panel appears, just like PCPlus or XTalk4:

uv run demos/bbs.py bbs.fozztexx.com
uv run demos/bbs.py bbs.fozztexx.com 23 -d ~/Downloads/bbs

Press Ctrl+] to disconnect.

Development

uv sync
uv run pytest

Tests require 100% branch coverage.

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

yesterwind_xyzmodem-0.1.1.tar.gz (44.1 kB view details)

Uploaded Source

Built Distribution

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

yesterwind_xyzmodem-0.1.1-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file yesterwind_xyzmodem-0.1.1.tar.gz.

File metadata

  • Download URL: yesterwind_xyzmodem-0.1.1.tar.gz
  • Upload date:
  • Size: 44.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yesterwind_xyzmodem-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3dcee9949a7e8e6aeaba808ef6518ccbf3dcfc1d7f2a6086586dde12a172d494
MD5 dc2676f2714fd64526a44e59018f253f
BLAKE2b-256 f523ebc23745cf044a7ff56bd3baadbd1a7f5d286e9d18a04717f7c8ce6f9564

See more details on using hashes here.

Provenance

The following attestation bundles were made for yesterwind_xyzmodem-0.1.1.tar.gz:

Publisher: publish.yml on ehwio/yesterwind-xyzmodem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yesterwind_xyzmodem-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for yesterwind_xyzmodem-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 54d07c784a8b587fcb7afdebafd55969bf89b054409ef5899f1887a774834eba
MD5 bbd064a7270cee1569555344285cf3bb
BLAKE2b-256 2855473a79584d8eecf80e7f511f37530f7a82838773e5ec1f2391a1b240fb93

See more details on using hashes here.

Provenance

The following attestation bundles were made for yesterwind_xyzmodem-0.1.1-py3-none-any.whl:

Publisher: publish.yml on ehwio/yesterwind-xyzmodem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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