In Python you can use StringIO for a file-like buffer for character data. Memory-mapped file basically does similar thing for binary data, but it requires a file that is use
Look at the struct package: https://docs.python.org/library/struct.html, it allows you to interpret strings as packed binary data.
Not sure if this will completely answer your question but you can use struct.unpack() to convert binary data to python objects.
import struct
f = open(filename, "rb")
s = f.read(8)
x, y = struct.unpack(">hl", s)
int this example, the ">" tells to read big-endian the "h" reads a 2-byte short, and the "l" is for a 4-byte long. you can obviously change these to whatever you need to read out of the binary data...