pyghidra
Native CPython for Ghidra
What it is and what it does
PyGhidra is a Python binding to Ghidra's reverse-engineering API, originally developed by the Department of Defense Cyber Crime Center. It uses JPype to run native CPython 3 code that can directly call Ghidra's Java API, eliminating the need to write GhidraScript in Java or Jython. The library provides high-level convenience functions for common tasks—starting the JVM, opening projects, loading programs, running analysis, and executing GhidraScripts—as well as lower-level access to Ghidra's full object model.
You can use PyGhidra standalone in Python workflows where Ghidra is one component among many, or integrate it with Ghidra's GUI via a built-in REPL and plugin. It supports both headless (command-line) and interactive modes, making it suitable for automation, batch analysis, and integration into larger reverse-engineering or malware-analysis pipelines.
Use it for:
- Automate binary analysis workflows by scripting Ghidra tasks in native Python instead of Java or GhidraScript
- Build batch processing pipelines to analyze multiple binaries and extract structured data (functions, strings, cross-references) programmatically
- Integrate Ghidra analysis into security research or malware-analysis frameworks as a Python library component
- Write custom analysis plugins in Python and run them from the Ghidra GUI via the PyGhidra plugin
- Combine Ghidra's disassembly and decompilation with Python data science or machine-learning tools for program analysis
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyGhidra provides native CPython 3 access to the Ghidra reverse-engineering API, enabling programmatic binary analysis and manipulation through Python instead of Java or GhidraScript.
Yes. PyGhidra is actively maintained, has no known vulnerabilities, installs with low friction, and is permissively licensed. Install it if you need to programmatically interact with Ghidra from Python or integrate Ghidra analysis into larger workflows. Prerequisite: Ghidra 12.0+ must be installed separately, and a Java runtime is required.
Install
pyghidra on PyPI
pip
pip install pyghidrauv
uv add pyghidrapoetry
poetry add pyghidraInstalling pyghidra
Before you install
Low friction: pure Python wheel with only two runtime dependencies (Jpype1 and packaging). Actively maintained with recent releases; repository shows strong community engagement (72376 stars). Supports Python 3.9 through 3.14.
License in practice
Apache-2.0 permissive license allows commercial and private use without restriction. No copyleft obligations; you may modify and redistribute under the same license terms.
Quickstart
pip install pyghidra
import pyghidra
launcher = pyghidra.start()
project = pyghidra.open_project('/path/to/project', 'myproject')
with pyghidra.program_context(project, '/path/to/binary') as program:
pyghidra.analyze(program)
Requires Ghidra 12.0 or later to be installed separately; PyGhidra will locate it via GHIDRA_INSTALL_DIR environment variable or last-used installation. JPype1 requires a Java runtime environment.
Verify before relying
- Whether offline installation from Ghidra's bundled pypkg/dist works reliably across all platforms
- Performance characteristics when analyzing large binaries or running complex GhidraScripts
- Compatibility guarantees with Ghidra versions beyond 12.0
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — Jpype1, packaging |
| Maintenance | actively maintained — 92 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 90,332/month — #13,598 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyghidra-3.1.0-py3-none-any.whl
Keywords: ghidra
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
pypcodepypcode provides machine code disassembly and…
permissive · top 15,000 on PyPI
cplexProvides a Python interface to IBM CPLEX's…
unclear · top 15,000 on PyPI
pyjksPyJKS loads and manipulates Java KeyStore…
permissive · top 5,000 on PyPI
javaobj-py3Reads and writes Java objects serialized by…
permissive · top 5,000 on PyPI
PyDrivePyDrive wraps the Google Drive API into Python…
unclear · top 15,000 on PyPI
py4jPy4J enables Python programs to dynamically…
permissive · top 1,000 on PyPI
pyxdiapyxdia extracts program metadata and symbol…
unclear · top 15,000 on PyPI
pyathenajdbcPyAthenaJDBC wraps the Amazon Athena JDBC…
permissive · top 15,000 on PyPI
idaproEnables programmatic binary analysis and…
permissive · top 15,000 on PyPI
pdfidAnalyzes PDF files to identify potentially…
permissive · top 15,000 on PyPI