skillfed

pmd-net-proto

The network-protocol packet parse/assemble layer of the PyTCP stack — Ethernet through TCP/UDP — fully usable on its own.

pmd-net-proto v0.0.3 100.8K downloads/30d#12,974 on PyPI376
Copyleft license GPL-3.0-or-later Active released

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-proto

uv

uv add pmd-net-proto

poetry

poetry add pmd-net-proto

Installing 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

Development Status :: 3 - AlphaNatural Language :: EnglishOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.14Topic :: System :: NetworkingTyping :: Typed

Tags

network packet parsingTCP/IP protocol codecwire format assemblypacket validationRFC-compliant protocol handlingIPv4 IPv6 parsingUDP TCP packet builder
packet-parsingprotocol-codecrfc-compliant

More Networking packages