pmd-net-proto
The network-protocol packet parse/assemble layer of the PyTCP stack — Ethernet through TCP/UDP — fully usable on its own.
What it is and what it does
pmd-net-proto is a network protocol codec library providing parser and assembler pairs for common Internet protocols—Ethernet, ARP, IPv4, IPv6, ICMPv4, ICMPv6, IGMP, TCP, UDP, DHCPv4, and DHCPv6—each with full RFC adherence, integrity and sanity validation, and typed wire enums. Every protocol follows a consistent six-file pattern: frozen header dataclass, base composition layer, three-phase RX parser pipeline, keyword-only TX assembler, and a two-axis error tree (IntegrityError for structural/wire-shape issues, SanityError for logical invariants).
The library is designed for strict, wire-hostile input handling: validation errors are typed exceptions that survive Python's -O optimization flag (unlike asserts), so they defend against malformed network data. Unknown wire codepoints are materialized as identity-stable pseudo-members via stdlib enum hooks, with no third-party enum library needed. It ships with py.typed and is strict-mypy clean, making it suitable for type-safe network protocol work in applications that need RFC-compliant, deterministic packet handling.
Use it for:
- Build network packet inspection tools that parse raw wire frames and validate against RFC specifications.
- Construct protocol-compliant packets (TCP, UDP, DHCP, etc.) for network testing or packet generation.
- Implement custom network stacks or protocol handlers that require strict validation and typed protocol enums.
- Debug network issues by parsing captured packets with detailed integrity and sanity error reporting.
- Develop network security tools that need to detect malformed or hostile wire input.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses, assembles, and validates network protocol packets (Ethernet through TCP/UDP) with RFC-grounded wire-format codecs and strict type safety.
Yes, if you need RFC-grounded network protocol parsing and assembly with strict validation. The package is actively maintained, has no known vulnerabilities, low install friction, and comprehensive protocol coverage. The GPL-3.0-or-later license is a blocker only for proprietary closed-source work. Verify the Python version requirement before committing to production.
Install
pmd-net-proto on PyPI
pip
pip install pmd-net-protouv
uv add pmd-net-protopoetry
poetry add pmd-net-protoInstalling pmd-net-proto
Before you install
Low friction: pure Python wheel with only two runtime dependencies (pmd-net-addr and typing_extensions). Actively maintained with a recent release (23 days old) and no known vulnerabilities.
License in practice
GPL-3.0-or-later copyleft license requires derivative works and distributions to be licensed under GPL-3.0 or later; suitable for open-source projects but not for proprietary closed-source applications.
Quickstart
pip install pmd-net-proto
from pmd_net_proto.protocols.udp.udp__parser import UdpParser
from pmd_net_proto.protocols.udp.udp__assembler import UdpAssembler
datagram = UdpAssembler(udp__sport=12345, udp__dport=53, udp__payload=b"query")
parsed = UdpParser(packet_rx) # raises UdpIntegrityError / UdpSanityError on bad input
Requires Python >=3.9; description mentions 3.14+ for PEP 695 generics—verify your Python version against the actual requirement.
Verify before relying
- Whether the description's Python 3.14+ requirement aligns with the metadata's requires_python >=3.9.
- Actual test coverage percentage beyond the stated ~99% source coverage claim.
- Whether the ~260 source modules and 5770 unit tests figures remain current for version 0.0.3.
Package facts
| License | GPL-3.0-or-later (copyleft) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pmd-net-addr, typing_extensions |
| Maintenance | actively maintained — 23 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 100,759/month — #12,974 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pmd_net_proto-0.0.3-py3-none-any.whl
Keywords: pmd_pytcp, networking, tcp, ip, ipv4, ipv6, arp, ethernet, icmp, udp
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
pmd-pytcpA pure-Python TCP/IP stack (Ethernet through…
copyleft · top 15,000 on PyPI
dpktdpkt parses and creates TCP/IP protocol packets…
permissive · top 5,000 on PyPI
threatwirethreatwire provides real-time network packet…
permissive · top 15,000 on PyPI
multiaddrParses, constructs, and manipulates…
permissive · top 15,000 on PyPI
pydivertPyDivert is a Python binding for the WinDivert…
copyleft · top 15,000 on PyPI
pytun-pmd3Provides Python bindings to create and manage…
copyleft · top 15,000 on PyPI
pyradpyrad implements RADIUS client and server…
permissive · top 15,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
spacepacketsImplements CCSDS and ECSS packet standards for…
permissive · top 15,000 on PyPI
mitmproxy-wireguardImplements a user-space WireGuard server that…
permissive · top 5,000 on PyPI