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¶
Libraries¶
There are also some libraries that help to implement network protocols without performing any I/O:
- ohneio (network protocol parsing; Getting started)
- gidgethub (GitHub API)
- google-music-proto (Google Music API)