Skip to main content

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.

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.1.3-py3-none-any.whl (3.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ghidra_stubs-12.1.3-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.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a0721ec097295db1581b712eeda3c7295bf25d428f82364ce601d60a88507100
MD5 474a51789c756c7e720cd760f6a018e2
BLAKE2b-256 ef33af5ff0745cae33254628c5b5ba3c9cc39fd716071a044f9b9010269e7892

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

12.1.3 This release

1 file

12.1.2

1 file

12.1

1 file

12.0.4

1 file

12.0.3

1 file

12.0.2

1 file

12.0.1

1 file

12.0

1 file

11.4.2

1 file

11.4.1

1 file

11.4

1 file

11.3.2

1 file

11.3.1

1 file

11.3.post2

1 file

11.3.post1

1 file

11.3

1 file

11.2.1.1.0.4

2 files

11.2.1.0.4

2 files

11.1.2.1.0.4

2 files

11.1.1.1.0.4

2 files

11.1.1.0.4

2 files

11.0.3.1.0.4

2 files

11.0.2.1.0.4

2 files

11.0.1.1.0.4

2 files

11.0.1.0.4

2 files

10.4.1.0.4

2 files

10.3.3.1.0.4

2 files

10.3.2.1.0.4

2 files

10.3.1.0.4

2 files

10.2.3.1.0.4

2 files

10.2.2.1.0.4

2 files

10.2.1.0.4

2 files

9.2.2.1.0.3

2 files

9.2.2.1.0.2

2 files

9.2.2.1.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page