pyelftools
Library for analyzing ELF files and DWARF debugging information
What it is and what it does
pyelftools is a pure-Python library for reading and analyzing ELF (Executable and Linkable Format) binaries and their embedded DWARF debugging metadata. It requires only Python 3 and has no external dependencies, making it straightforward to integrate into tools that need to inspect compiled binaries, extract debug symbols, or analyze executable structure.
The library is used in debuggers, disassemblers, binary analysis tools, and compiler infrastructure. It handles the low-level parsing of ELF headers, sections, segments, and symbol tables, as well as DWARF format data. Since it is pure Python, it can be embedded directly in projects without system library requirements, though it is also available on PyPI for standard installation.
Use it for:
- Extract debug symbols and line number information from compiled binaries for debugger integration
- Analyze ELF binary structure to understand sections, segments, and symbol tables in reverse-engineering tools
- Parse DWARF metadata to recover source-level information from stripped or optimized executables
- Build binary analysis and instrumentation tools that need to read ELF metadata without external C libraries
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pyelftools parses and analyzes ELF binary files and DWARF debugging information in pure Python, with no external dependencies.
Yes. pyelftools is stable (production/stable status), actively maintained, has no dependencies, and is permissively licensed under public domain. It is the standard choice for Python-based ELF and DWARF parsing. Install it if you need to read or analyze ELF binaries or debug information from Python.
Install
pyelftools on PyPI
pip
pip install pyelftoolsuv
uv add pyelftoolspoetry
poetry add pyelftoolsInstalling pyelftools
Before you install
Low friction: pure Python with no runtime dependencies, distributed as a wheel. Active maintenance with a recent release 77 days ago and 2270 repository stars.
License in practice
Public domain license permits unrestricted use, modification, and distribution with no attribution or copyleft obligations.
Quickstart
pip install pyelftools
import pyelftools
# See user's guide for detailed usage examples
Requires Python 3.10 or later; input must be a valid ELF binary file.
Verify before relying
- Specific DWARF versions or ELF variants supported beyond the general claim
- Performance characteristics or file size limits for large binaries
- Whether the library can be used without installation by adjusting PYTHONPATH as described
Package facts
| License | Public domain (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 77 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 16,037,769/month — #1,165 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyelftools-0.33-py3-none-any.whl
Tags
More Compilers packages
pyparsing provides a library for building text…
permissive · top 1,000 on PyPI
CythonCython is a source code translator that…
permissive · top 1,000 on PyPI
asttokensAnnotates Python abstract syntax trees with the…
permissive · top 1,000 on PyPI
numbaNumba is a just-in-time compiler that…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
llvmlitellvmlite provides a lightweight Python binding…
permissive · top 1,000 on PyPI
binsizeAnalyzes symbol sizes in compiled binaries by…
permissive · top 15,000 on PyPI
pwntoolsPwntools is a CTF framework and exploit…
permissive · top 5,000 on PyPI
liefLIEF parses, modifies, and abstracts binary…
permissive · top 5,000 on PyPI
patchelfProvides a PyPI-packaged binary of patchelf, a…
copyleft · top 5,000 on PyPI
guppy3Guppy 3 analyzes Python heap memory to identify…
permissive · top 5,000 on PyPI
membrowseAnalyzes binary size and memory footprint of…
unclear · top 15,000 on PyPI
cleCLE loads binary executables and shared…
permissive · top 5,000 on PyPI
leb128Encodes and decodes integers using LEB128…
permissive · top 5,000 on PyPI
pydevd-pycharmPyCharm's debugger backend for remote debugging…
permissive · top 15,000 on PyPI
depyfDecompile and inspect the internal bytecode and…
permissive · top 5,000 on PyPI