I glanced at a Python script published by a security company called Fox It to check if it was a vulnerability in OpenSSL, but I was surprised at the notation like Wireshark's Bytes display.
Wireshark on the left and script on the right.
The function h2bin (x), which is one level higher, just removes spaces and line breaks and decodes it, but it's an interesting device. Is it a common practice for people who program with sockets?