Goblin is a Rust library for parsing ELF files. This package provides Python bindings for Goblin exposing most of the information available through the library.
pip install fact_goblin_bindings
from fact_goblin_bindings import ElfFile
with open("/path/to/binary", "rb") as file:
binary = file.read()
elf_file = ElfFile(binary)
print(elf_file.header)
Use the Python documentation available through help(ElfFile)
to get more information about the data provided by the bindings.