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.2.tar.gz (44.2 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.2-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yesterwind_xyzmodem-0.1.2.tar.gz
  • Upload date:
  • Size: 44.2 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.2.tar.gz
Algorithm Hash digest
SHA256 76abd1fa75fc03fd134e613cf4fb39769436dbf9a3f25e4903a2f28836c2b611
MD5 4583c7bf29fd1ce776b853ff86d00b5f
BLAKE2b-256 0ecd02a0302212c1df2ddcb10badc5b48f237ccfa841d3870d86321d9390017a

See more details on using hashes here.

Provenance

The following attestation bundles were made for yesterwind_xyzmodem-0.1.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for yesterwind_xyzmodem-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37de09daf67591669282718f09f9e019b40216456996c97da02f7845b67be343
MD5 8d6f3d930c963a6c092c026787440bdf
BLAKE2b-256 819cb5c83c84264523aa4cf19bb491b2422486d4fa5b5c89298f0150bc95223b

See more details on using hashes here.

Provenance

The following attestation bundles were made for yesterwind_xyzmodem-0.1.2-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