Have you tried the bitstring module? (Full disclosure: I wrote it).
It's designed to make constructing and parsing binary data as simple as possible. Take a look at a few examples to see if it's anything like you need.
This snippet does some parsing of a H.264 video file:
from bitstring import Bits
s = Bits(filename='somefile.h264')
profile_idc = s.read('uint:8')
# Multiple reads in one go returns a list:
constraint_flags = s.readlist('4*uint:1')
reserved_zero_4bits = s.read('bin:4')
level_idc = s.read('uint:8')
seq_parameter_set_id = s.read('ue')
if profile_idc in [100, 110, 122, 244, 44, 83, 86]:
chroma_format_idc = s.read('ue')
if chroma_format_idc == 3:
separate_colour_plane_flag = s.read('uint:1')
bit_depth_luma_minus8 = s.read('ue')
bit_depth_chroma_minus8 = s.read('ue')
...