Network protocols, sans I/O

This page is to provide a single location for people to reference when looking for network protocol implementations written in Python that perform no I/O (this means libraries that operate directly on text or bytes; this excludes libraries that just abstract out I/O).

Why?

In a word: reusability. By implementing network protocols without any I/O and instead operating on bytes or text alone, libraries allow for reuse by other code regardless of their I/O decisions. In other words by leaving I/O out of the picture a network protocol library allows itself to be used by both synchronous and asynchronous I/O code. And by not simply abstracting out the I/O it allows users of the library to drive the network interactions themselves, not the network protocol library itself; not forcing I/O code to have to conform to a certain API provides the greatest flexibility for users of such low-level details such as network protocols. Working towards this unbinding of network protocols from I/O is very important as the Python community migrates from synchronous I/O code to using async/await for asynchronous I/O.

Cory Benfield’s PyCon US 2016 talk provides a nice overview as to why designing protocol implementations this way is important and the best way to do so going forward for the Python community.

More Detail

For more detail, see the following documents:

Implementations

Protocol

Project

FastCGI

fcgiproto

HTTP/2

hyper-h2

HTTP/1.1

h11

IRC

ircproto

OAuth 1.0 & OAuth 2.0

oauthlib

WebSocket

wsproto

SOCKSv5

socks5

SOCKSv4 & SOCKSv5

siosocks

RFC 2217 (Serial over IP)

pyserial

EPICS Channel Access

caproto

FIX 4.0 - 5.0

simplefix

QUIC & HTTP/3

aioquic

Language Server Protocol

lsp

SMTP

smtpproto

D-Bus

jeepney

Thorlabs APT

thorlabs-apt-protocol

Matrix

matrix-nio

SSL/TLS

cpython

Libraries

There are also some libraries that help to implement network protocols without performing any I/O: