Skip to main content

Ghidra Type Stubs

Project description

Ghidra Type Stubs

The Ghidra Type Stubs library is a PEP 561 stubs package for the Ghidra API. The stub files can be used to improve your development experience in supported editors like PyCharm and Visual Studio Code.

Installation

The stubs can be installed with pip install ghidra-stubs*.whl into the environment in which the real Ghidra module (i.e., pyghidra) is available. Any conformant tool will then use the stubs package for type analysis purposes.

Usage

Once installed, all you need to do is import the Ghidra modules as usual, and your supported editor will do the rest.

import pyghidra

To get support for the Ghidra builtins, you need to import them as well. The type hints for those exist in the generated ghidra_builtins stub. Since it is not a real Python module, importing it at runtime will fail.

try:
    from ghidra.ghidra_builtins import *
except:
    pass

If you are using PyGhidra from a Python 3 environment where no real ghidra module exists you can use a snippet like the following:

import typing
if typing.TYPE_CHECKING:
    from ghidra.ghidra_builtins import *

# actual code follows here

typing.TYPE_CHECKING is a special value that is always False at runtime but True during any kind of type checking or completion.

Once done, just code & enjoy.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ghidra_stubs-12.0.4-py3-none-any.whl (3.7 MB view details)

Uploaded Python 3

File details

Details for the file ghidra_stubs-12.0.4-py3-none-any.whl.

File metadata

  • Download URL: ghidra_stubs-12.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for ghidra_stubs-12.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 069b677f7b149739ff1460a12a524c5be1794ec9ccefa1ef1b32297273af2b7d
MD5 05870c64efa1a0fce74f8613b4998e28
BLAKE2b-256 7d075f565f8654d213ccaf15c1abb54c72ce76cd987515c72a5a137f105daa34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page