Python Read Byte Stream, and if the Python standard library doesn't work for you, you may be interested in bitstream.