Skip to main content

cable-station

BETA, untested. Version 0.1.0 is the first public packaging of a tool that has run on one machine; expect rough edges, and check the first few labels by hand.

Read what a USB-C cable can really do, keep one note per cable, and print a small flag that says so.

Start here. cable-station is a terminal program for sorting a drawer of USB-C cables. Every full-featured USB-C cable carries an e-marker, a chip that states the cable's ratings: how many amps it may carry, whether it supports 240 W Extended Power Range (EPR), which data speed it is wired for, and whether it is passive or active. The station reads that chip in one of two ways, records the result as a Markdown note, and prints a two-line wrap-flag label on a Brother P-touch so the answer travels with the cable. It was built around the ChargerLAB POWER-Z KM003C, a USB-C power and Power Delivery tester, and it also works with nothing but an Apple Silicon Mac.

In plain terms

You have twenty black USB-C cables and no idea which one charges the laptop at full speed, which one is safe for the fast drive, and which one is a phone-charging cable that only does USB 2.0. Cables do not say. This program asks the chip inside each cable, writes down the answer, and prints a label such as USB4 20G · USB 3.2 10G over 100W 5A · #17 that you wrap around the cable.

  • One pass, labelled for good: seat each cable once, press Enter, and the cable comes out of the drawer with a flag.
  • The answer comes from the cable itself: the ratings are read from the e-marker chip, not guessed from the plug or the brand.
  • Every cable gets a number: #17 on the flag matches note C17.md, so a cable can be retested, retired, or found again.
  • Your records stay yours: the notes are plain Markdown files in a folder you choose, readable in any editor and as a table in Obsidian.

What it does

The station shows one table: the pending reading on top, every recorded cable below, and the rows whose chip identity matches the pending reading highlighted. Pressing Enter opens a preview of the flag; pressing Enter again prints it and writes the note. Two paths feed the pending reading:

  1. Tester path (primary). The POWER-Z KM003C sits on USB with the cable under test seated in its socket. You run the tester's USB-C eMarker module (Application › Modules › USB-C eMarker); the station runs km003c pd capture --raw in the background, catches the cable's Discover Identity answer on the cable channel (SOP'), and decodes the ID Header and Cable VDO per the USB Power Delivery specification.
  2. Mac path. On macOS, the Mac's own port controller asks the cable the same question when a device is plugged in through it. cable-station reads the answer from the I/O Registry (Port-USB-C@N / CC / SOP') together with the link that trained (USB 2, USB 3, Thunderbolt or USB4) and the device on the far end. Modes 2 (drive) and 3 (dock) watch the ports for a partner device you name in the config.

A cable with no chip is, by the USB-C specification, a 3 A, 60 W, USB 2.0 cable, and the label says so. A cable that connects but never carries data is labelled PWR ONLY · no data; when its chip still answers, the note records the claim and says the data wires failed.

Install

uv tool install cable-station

or, on macOS with Homebrew:

brew install johntrandall/tap/cable-station

Python 3.11 or newer, Textual 8 and Pillow are the only Python requirements. Two optional tools unlock the two optional features:

  • Tester path: the km003c CLI from okhsunrog/km003c-rs (MIT or Apache-2.0). Build it with cargo build --release -p km003c-cli in a clone of that repository and put the binary on your PATH, or set km003c = "/path/to/km003c" in the config. The pull request km003c-rs #67 adds a km003c cable command that reads the e-marker directly; until it lands, the station uses the capture route described above.
  • Printing: ptouch-label, which drives Brother PT-P750W and PT-P950NW printers over the network: uv tool install git+https://github.com/johntrandall/ptouch-label. Without it, the station still renders every flag as a PNG in its state folder.

cable-station doctor tells you which of these it can see.

Quick start

cable-station doctor          # what is installed, where the records go
cable-station                 # the station (mode 1, tester)
cable-station snapshot        # macOS: every USB-C port's chip, link, and partner, right now
cable-station decode capture.log   # the e-marker from a saved `km003c pd capture --raw` log
cable-station print 17        # reprint cable #17's flag

A snapshot on a Mac with a dock on port 3 looks like this:

port 1: connected True · nothing · link DisplayPort 8.1 Gbps (HBR3) · no e-marker answered
port 2: connected False · nothing · link no link · no e-marker answered
port 3: connected True · TS5 Plus / USB3 HUB · link Thunderbolt/USB4 40 Gb/s · chip vendor 0x2B1D product 0x192B passive ('USB4 20G · USB 3.2 10G', '240W 5A EPR') VDO 0x420A4E42

The keys

Key What it does
Enter Preview the pending reading's flag; Enter again prints it with a new number and writes the note. With nothing pending, reprints the highlighted row.
r Reprint the highlighted cable's flag (no new note).
1 2 3 4 Mode: 1 tester (readings come from the POWER-Z capture), 2 drive, 3 dock (the Mac reads the cable plugged between it and the named partner), 4 lightning (an iPhone or iPad enumerating on the Mac is the reading).
c p In lightning mode: c cycles the other end's plug (Lightning, USB-A to Lightning, USB-C to Lightning); p stages a power-only Lightning cable.
n Stage the seated cable as chipless and untested (no eMarker · USB 2.0 480M over 60W 3A); Enter prints it.
w Write the pending reading into the highlighted row, a retest that keeps the number; press w twice.
x Decommission the highlighted cable (broken or discarded); the record and number are kept; press x twice. u undoes it.
s Discard the pending reading.
q Quit; the capture stops with the station.

Green rows share the pending reading's chip identity (vendor, product, cable VDO): the same cable again, or an identical one. Cyan rows are chipless cables of the same speed tier, which have no identity to compare.

The label

Two lines on 9 mm tape, printed twice on one strip with a 20 mm wrap zone and a dotted fold line between, so both faces of the flag read the same.

Line Content Examples
1, data Every mode the cable supports, highest first, separated by a middle dot, then Active on an active cable; a Thunderbolt link trained on the Mac names the generation with a bolt USB 2.0 480M · USB 3.2 5G · USB4 20G · USB 3.2 10G · USB4 ≥40G · USB 3.2 10G Active · TB4 ⚡ 40G · USB 3.2 10G
2, power Watts, amps, EPR on 240 W cables, then the cable's number 60W 3A · #3 · 100W 5A · #17 · 240W 5A EPR · #21
no chip Line 1 names the fact and the tested data speed; line 2 the specification default no eMarker · USB 2.0 480M / 60W 3A · #8
power only A cable that charges but never carries data PWR ONLY · no data / 60W 3A · #9

≥40G means the chip's speed code says USB4 Gen 3: verified to 40G and possibly higher, until an 80G cable has been read on this firmware. Watts come first because that is the question at the drawer; amps second because chargers and docks talk in amps. Nothing else goes on the flag: a missing marker means passive and not EPR.

The data layout

Records live in the data folder (default ~/cable-station/cables), one Markdown note per cable named C<N>.md. The frontmatter holds the fields; the body is free text.

---
type: cable
id: C17
tested: 2026-11-12
connector: USB-C to USB-C
data_label: "USB4 20G · USB 3.2 10G"
power_label: "100W 5A · #17"
current_a: 5
epr: false
speed: "USB4 20G · USB 3.2 10G"
active: false
emarker: true
emarker_read: true
vendor: 0x2B1D
product: 0x192B
cable_vdo: 0x00084042
status: active
---

# C17 · USB4 20G · USB 3.2 10G · 100W 5A · #17

Beside the notes the station keeps _cables.base, an Obsidian Base that shows the folder as a table (view 1 · CABLES). Point an Obsidian vault at the folder, or make the folder part of one. The station's own files (the capture log, each cable's raw capture, the rendered flag PNGs) go to the state folder, default ~/.local/state/cable-station, and are not records.

Configuration

Settings come from ~/.config/cable-station/config.toml, overridden by CABLE_STATION_* environment variables. Every key is optional.

data_dir = "~/cable-station/cables"        # the records (CABLE_STATION_DATA)
state_dir = "~/.local/state/cable-station"  # logs, captures, previews (CABLE_STATION_STATE)
printer_model = "PT-P950NW"                 # ptouch-label --model (CABLE_STATION_PRINTER)
tape_mm = 9                                 # 6, 9, 12, 18 or 24 (CABLE_STATION_TAPE)
km003c = "km003c"                           # the tester CLI (CABLE_STATION_KM003C)
capture_hours = 3                           # one capture run before it restarts
connector = "USB-C to USB-C"                # recorded on new cables
vertical_offset_mm = 1.45                   # your printer's vertical calibration offset

[partners]
drive = ["Envoy", "Sabrent"]                # mode 2 watches ports where one of these appears (CABLE_STATION_DRIVE_PARTNERS)
dock = ["TS5"]                              # mode 3 (CABLE_STATION_DOCK_PARTNERS)

Partner names are matched against what macOS reports for the device on the far end of the cable. With no partners configured, modes 2 and 3 watch every port that gains a device.

Limits

  • No throughput test yet. A read-only "real work" test through the cable exists as a module (cable-station snapshot --read-test VOLUME) but is experimental and does not feed the label; its floors are provisional.
  • No power test yet. The label's watts are what the chip claims. A worn cable still claims its rating; a voltage-drop test under load is planned, not built.
  • The Mac reader is macOS only. It reads the I/O Registry. On Linux the tester path, the records, and printing all work.
  • The tester's eMarker module is a button press. The KM003C sends the Discover Identity only while its USB-C eMarker screen is open, so each cable is one hands-on step on the tester. The vendor's serial protocol-trigger route does not reach the cable in the socket; a direct read is the subject of km003c-rs pull request #67.
  • Chipless does not mean USB 2.0. Only the tester proves "no e-marker"; the Mac proves the link that trained. A Mac-only reading of a 20G or faster link proves a chip exists and is recorded as emarker_read: false until the tester reads it.
  • Verified on one machine. The PD 2.0 versus 3.x layout of the cable VDO is chosen from ioreg's Specification Revision; checked on an M3 Max MacBook Pro running macOS 15, not against every Mac.

Status

Beta, untested beyond one machine. The station has labelled one household's cable drawer; the vocabulary and keys are settled, the packaging is new. Next: the direct km003c cable read once km003c-rs #67 lands, a power test, and the throughput test as an opt-in.

Credits

Contributing

Issues and pull requests at github.com/johntrandall/cable-station. A capture log from a cable the decoder gets wrong is the most useful bug report: km003c pd capture --raw --duration 60 > capture.log while you open the tester's eMarker module, then attach the log.

License

MIT, John Randall.

Metadata

Release files for cable-station 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cable-station 0.1.0
File Size Uploaded Provenance Actions
cable_station-0.1.0.tar.gz 42.2 kB Without provenance Details for cable_station-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cable-station 0.1.0
File Interpreter ABI Platform Actions
cable_station-0.1.0-py3-none-any.whl Python 3 none any Details for cable_station-0.1.0-py3-none-any.whl

Total release size: 77.1 kB

Release files / cable_station-0.1.0.tar.gz

Download URL cable_station-0.1.0.tar.gz
Size 42.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1c649102e955dd2e310424583ed7e21522dc67091a539f43cc016a24fa12c6d8
BLAKE2b-256 checksum
How to use checksums
1b927a9e7479a47317b883d8781a20d1004ceb2b322f198e2d304113af99ef64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / cable_station-0.1.0-py3-none-any.whl

Download URL cable_station-0.1.0-py3-none-any.whl
Size 34.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2a4559ae0e0ab5df05b28e50217e32e9c6271b1018817315e21842bc8c7aa4e
BLAKE2b-256 checksum
How to use checksums
cfa5980e208a8099f17fd065ac9965e7fe44b279a6ddfd7410913c19f0e5030b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for cable-station 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page