refactor: scaffold sniff/, transponders/, reader/, sim/ sub-packages
Phases 2-4 of package refactor. Creates the full directory tree with __init__.py files per the design doc. Actual code migration from the sim worktree is a separate effort — models have deep inheritance chains and auth mixins that need base class extraction first. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -33,20 +33,42 @@
|
|||||||
|
|
||||||
## Phase 2 — Extract `sniff/`
|
## Phase 2 — Extract `sniff/`
|
||||||
|
|
||||||
**Status: Deferred — no sniff infrastructure exists yet**
|
**Status: Scaffolded — extraction deferred**
|
||||||
|
|
||||||
`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.
|
`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.
|
Created `pm3py/sniff/__init__.py` placeholder. Will extract into sub-modules when sniff infrastructure is implemented.
|
||||||
|
|
||||||
## Phase 3 — Scaffold `transponders/`
|
## Phase 3 — Scaffold `transponders/`
|
||||||
|
|
||||||
**Status: Not started — models live in sim worktree**
|
**Status: Complete (scaffolded)**
|
||||||
|
|
||||||
Transponder models exist in `.worktrees/sim-framework/` but haven't been merged to master. Scaffold when ready to migrate.
|
Created full directory tree per design:
|
||||||
|
- `transponders/hf/iso14443a3/nxp/` — MIFARE Classic, Ultralight, NTAG
|
||||||
|
- `transponders/hf/iso14443a4/nxp/` — DESFire, NTAG 5
|
||||||
|
- `transponders/hf/iso15693/nxp/` — ICODE SLIX2
|
||||||
|
- `transponders/hf/iso15693/st/` — ST25TV
|
||||||
|
- `transponders/lf/atmel/` — T55xx
|
||||||
|
- `transponders/lf/em/` — EM4100, EM4x05
|
||||||
|
|
||||||
|
All directories have `__init__.py`. Model migration from sim worktree is a separate effort — the sim framework has ~7.8k LOC with deep inheritance chains (`Transponder` → `Tag15693` → `NxpIcodeTag` → `IcodeSlix2Tag`, etc.) and auth mixins (`NxpPasswordAuth`, `NxpAesAuth`). Base class extraction needs to happen alongside model migration.
|
||||||
|
|
||||||
## Phase 4 — Scaffold `reader/` and `sim/`
|
## Phase 4 — Scaffold `reader/` and `sim/`
|
||||||
|
|
||||||
**Status: Not started**
|
**Status: Complete (scaffolded)**
|
||||||
|
|
||||||
Depends on Phase 3 and sim worktree merge.
|
Created directory trees per design:
|
||||||
|
- `reader/hf/nxp/` — NXP reader ICs (CLRC663, PN5xx)
|
||||||
|
- `reader/hf/st/` — ST reader ICs
|
||||||
|
- `reader/lf/`
|
||||||
|
- `reader/modes/` — inventory, programming, access control workflows
|
||||||
|
- `sim/` — sim session, table compiler, relay (migrate from worktree)
|
||||||
|
|
||||||
|
All directories have `__init__.py`. Sim migration (~41 files, 7.8k LOC) is a separate effort.
|
||||||
|
|
||||||
|
## Next Steps
|
||||||
|
|
||||||
|
- Sniff infrastructure: implement trace parsing, 15693 decoders, NDEF annotation, ANSI formatting in `sniff/`
|
||||||
|
- Transponder migration: extract base classes from sim worktree, populate `transponders/` modules
|
||||||
|
- Sim migration: move sim session, table compiler, relay into `sim/`
|
||||||
|
- Reader modes: implement inventory, programming, access workflows in `reader/modes/`
|
||||||
|
|||||||
1
pm3py/reader/__init__.py
Normal file
1
pm3py/reader/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""pm3py.reader — Higher-level reader modes composing core commands."""
|
||||||
1
pm3py/reader/hf/__init__.py
Normal file
1
pm3py/reader/hf/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""HF reader modes organized by reader IC manufacturer."""
|
||||||
1
pm3py/reader/hf/nxp/__init__.py
Normal file
1
pm3py/reader/hf/nxp/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""NXP reader ICs (CLRC663, PN5xx)."""
|
||||||
1
pm3py/reader/hf/st/__init__.py
Normal file
1
pm3py/reader/hf/st/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""ST Microelectronics reader ICs."""
|
||||||
1
pm3py/reader/lf/__init__.py
Normal file
1
pm3py/reader/lf/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""LF reader modes."""
|
||||||
1
pm3py/reader/modes/__init__.py
Normal file
1
pm3py/reader/modes/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""Reader workflow modes — inventory, programming, access control."""
|
||||||
1
pm3py/sim/__init__.py
Normal file
1
pm3py/sim/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""pm3py.sim — Card simulation sessions, table compiler, relay."""
|
||||||
1
pm3py/sniff/__init__.py
Normal file
1
pm3py/sniff/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""pm3py.sniff — Sniff sessions, trace parsing, protocol decoders, formatting."""
|
||||||
1
pm3py/transponders/__init__.py
Normal file
1
pm3py/transponders/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""pm3py.transponders — Tag/transponder models independent of hardware."""
|
||||||
1
pm3py/transponders/hf/__init__.py
Normal file
1
pm3py/transponders/hf/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""HF transponder models organized by ISO standard, then manufacturer."""
|
||||||
1
pm3py/transponders/hf/iso14443a3/__init__.py
Normal file
1
pm3py/transponders/hf/iso14443a3/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""ISO 14443-A Layer 3 transponders (MIFARE Classic, Ultralight, NTAG)."""
|
||||||
1
pm3py/transponders/hf/iso14443a3/nxp/__init__.py
Normal file
1
pm3py/transponders/hf/iso14443a3/nxp/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""NXP ISO 14443-A Layer 3 transponders."""
|
||||||
1
pm3py/transponders/hf/iso14443a4/__init__.py
Normal file
1
pm3py/transponders/hf/iso14443a4/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""ISO 14443-A Layer 4 (ISO-DEP) transponders (DESFire, NTAG 5 via -4)."""
|
||||||
1
pm3py/transponders/hf/iso14443a4/nxp/__init__.py
Normal file
1
pm3py/transponders/hf/iso14443a4/nxp/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""NXP ISO 14443-A Layer 4 transponders."""
|
||||||
1
pm3py/transponders/hf/iso15693/__init__.py
Normal file
1
pm3py/transponders/hf/iso15693/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""ISO 15693 transponder models and NFC Forum Type 5 NDEF."""
|
||||||
1
pm3py/transponders/hf/iso15693/nxp/__init__.py
Normal file
1
pm3py/transponders/hf/iso15693/nxp/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""NXP ICODE / NTAG 5 ISO 15693 transponders."""
|
||||||
1
pm3py/transponders/hf/iso15693/st/__init__.py
Normal file
1
pm3py/transponders/hf/iso15693/st/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""ST Microelectronics ISO 15693 transponders."""
|
||||||
1
pm3py/transponders/lf/__init__.py
Normal file
1
pm3py/transponders/lf/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""LF transponder models organized by manufacturer."""
|
||||||
1
pm3py/transponders/lf/atmel/__init__.py
Normal file
1
pm3py/transponders/lf/atmel/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""Atmel/Microchip LF transponders (T55xx)."""
|
||||||
1
pm3py/transponders/lf/em/__init__.py
Normal file
1
pm3py/transponders/lf/em/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"""EM Microelectronic LF transponders (EM4100, EM4x05)."""
|
||||||
Reference in New Issue
Block a user