How gkshub/doip_python works
This repository is a Python DoIP (Diagnostics over IP) client implementation with:
• A core client/engine layer (src/doip_client/doip_engine.py) orchestrating DoIP communication
• A protocol + message modeling layer (src/doip_client/lib/doip_protocol.py, doip_messages.py)
• Network connectivity + discovery utilities (connection.py, discovery.py)
• Configuration loading from JSON (json_config.py, config/config_client.json, config/config_server.json)
• A CLI entrypoint (src/doip_client/run_cli.py, src/doip_client/main.py)
• Tests (tests/)
• A currently minimal/placeholder web/ package (exists but no internal modules in the tree)
So the “system” is not a multi-service backend; it’s primarily a client-side tool/library that communicates with an external DoIP server/ECU over the network (UDP discovery + TCP diagnostic session in typical DoIP setups).
From the tree:
Entrypoints / UI layer
• src/doip_client/run_cli.py and src/doip_client/main.py
Orchestration / Application layer
• src/doip_client/doip_engine.py
Configuration layer
• src/doip_client/json_config.py
• config/config_client.json
• config/config_server.json
Core library (Protocol + Networking) — “domain” for this project
• src/doip_client/lib/connection.py
• src/doip_client/lib/discovery.py
• src/doip_client/lib/doip_protocol.py
• src/doip_client/lib/doip_messages.py
Quality / Verification
• tests/
Web
• web/__init__.py only
(Optional) Network boundary (LAN / Automotive Ethernet)
• UDP Discovery Channel (Discovery ↔ ECU)
• TCP Diagnostic Channel (Connection ↔ ECU)
Architectural patterns present (what to highlight explicitly)
Even though it’s a single-process project, it has clear layering:
• Interface layer: CLI
• Application orchestration: DoIPEngine
• Infrastructure: sockets/connection + discovery
• Protocol modeling: message definitions + codec/protocol handler
• External system boundary: ECU/DoIP server
Call out that this is essentially a library + tool design:
• The lib/ folder is the reusable core
• The main.py/run_cli.py are “adapters” for interactive usage
From the repo, it’s pure Python; the meaningful tech is:
• Python runtime
• Sockets / networking (even if not explicitly listed, connection.py implies it)
• DoIP protocol (domain protocol)
• JSON config (config files + loader)
Engine prints result / exits
• encode(message) in protocol handler
• send(bytes) in connection
• recv(bytes) and decode(bytes)
“Don’t overthink it” but be very detailed (how to maximize component separation)
For this repo, “separating into as many components as possible” means:
• Split Discovery and Connection explicitly (don’t combine them into “Networking”)
• Split Protocol codec from Message definitions
• Split Engine orchestration from CLI
• Split Config files from Config loader
One note on README vs tree mismatch (how to handle
The README’s example structure mentions app.py and run_cli.py at repo root, but the actual tree shows:
• src/doip_client/main.py
• src/doip_client/run_cli.py
• no app.py at root