Files
pm3py/docs/plans/2026-03-18-refactor-progress.md
michael 42e6b54f29 refactor: move modules into core/ sub-package, normalize naming
Phase 1 of package refactor. Moves all source modules into pm3py/core/
with file renames (hf_14a→hf_iso14a, hf_15→hf_iso15, hf_mf→hf_mfc)
and client attribute normalization (hf.a14→hf.iso14a, hf.mf→hf.mfc).
pm3py/__init__.py re-exports from core for backward compat.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 19:24:05 -07:00

1.9 KiB

pm3py Refactor Progress

Design: 2026-03-18-refactor-design.md Branch: refactor/core-package Started: 2026-03-18

Phase 1 — Create core/, normalize names, fix imports

Status: Complete

What was done

  • Created pm3py/core/ sub-package
  • Moved all source modules into core/:
    • protocol.py, transport.py, client.py, hw.py, hf.py, lf.py — moved as-is
    • hf_14a.pyhf_iso14a.py (renamed)
    • hf_15.pyhf_iso15.py (renamed)
    • hf_mf.pyhf_mfc.py (renamed)
  • Normalized client attributes:
    • hf.a14hf.iso14a
    • hf.mfhf.mfc
    • hf.iso15 — unchanged
  • Created core/__init__.py re-exporting: Proxmark3, FirmwareInfo, PM3Transport, PM3Error, PM3Response, PM3Status, Cmd
  • Updated pm3py/__init__.py to import from .core.*
  • Updated all 10 test files (imports + attribute references)
  • 30/30 tests passing

Backward compatibility

  • from pm3py import Proxmark3 still works (re-exported)
  • Breaking: hf.a14hf.iso14a, hf.mfhf.mfc
  • Breaking: Direct imports like from pm3py.hf_14a import ...from pm3py.core.hf_iso14a import ...

Phase 2 — Extract sniff/

Status: Deferred — no sniff infrastructure exists yet

hf_iso15.py is 94 lines of clean reader commands + thin sniff() firmware call. The trace parsing, 15693 decoders, NDEF annotation, and ANSI formatting described in the design doc haven't been written yet. Nothing to extract.

Will revisit when sniff infrastructure is implemented.

Phase 3 — Scaffold transponders/

Status: Not started — models live in sim worktree

Transponder models exist in .worktrees/sim-framework/ but haven't been merged to master. Scaffold when ready to migrate.

Phase 4 — Scaffold reader/ and sim/

Status: Not started

Depends on Phase 3 and sim worktree merge.