For the impatient, to start reading and inspecting an ELF file, use the libelf module:
from pylibelf import libelf
print libelf.Library("/bin/ls")
As you can see, this will pretty print the entire ELF file, which may be customized by using the Convenience functions function from the elf module.