Name | ghidra-stubs JSON |
Version |
11.3.post2
JSON |
| download |
home_page | None |
Summary | Ghidra Type Stubs |
upload_time | 2025-02-07 12:26:03 |
maintainer | Ghidra Development Team |
docs_url | None |
author | None |
requires_python | None |
license | Apache-2.0 |
keywords |
ghidra
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Ghidra Type Stubs
The Ghidra Type Stubs library is a [PEP 561 stubs package][pep-0561] for the
[Ghidra API](https://github.com/NationalSecurityAgency/ghidra). 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.
```python
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.
```python
try:
from ghidra.ghidra_builtins import *
except:
pass
```
If you are using [PyGhidra](https://pypi.org/project/pyghidra/) from a Python 3 environment where no
real `ghidra` module exists you can use a snippet like the following:
```python
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.
[pep-0484]: https://www.python.org/dev/peps/pep-0484/
[pep-0561]: https://www.python.org/dev/peps/pep-0561/#stub-only-packages
Raw data
{
"_id": null,
"home_page": null,
"name": "ghidra-stubs",
"maintainer": "Ghidra Development Team",
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "ghidra",
"author": null,
"author_email": null,
"download_url": null,
"platform": null,
"description": "# Ghidra Type Stubs\n\nThe Ghidra Type Stubs library is a [PEP 561 stubs package][pep-0561] for the \n[Ghidra API](https://github.com/NationalSecurityAgency/ghidra). The stub files can be used to \nimprove your development experience in supported editors like PyCharm and Visual Studio Code.\n\n## Installation \n\nThe stubs can be installed with `pip install ghidra-stubs*.whl` into the environment in which the \nreal Ghidra module (i.e., `pyghidra`) is available. Any conformant tool will then use the stubs \npackage for type analysis purposes. \n\n## Usage\n\nOnce installed, all you need to do is import the Ghidra modules as usual, and your supported editor\nwill do the rest.\n\n```python\nimport pyghidra\n```\n\nTo get support for the Ghidra builtins, you need to import them as well. The type hints for those \nexist in the generated `ghidra_builtins` stub. Since it is not a real Python module, importing it at\nruntime will fail.\n\n```python\ntry:\n from ghidra.ghidra_builtins import *\nexcept:\n pass\n```\n\nIf you are using [PyGhidra](https://pypi.org/project/pyghidra/) from a Python 3 environment where no\nreal `ghidra` module exists you can use a snippet like the following:\n\n```python\nimport typing\nif typing.TYPE_CHECKING:\n from ghidra.ghidra_builtins import *\n\n# actual code follows here\n```\n\n`typing.TYPE_CHECKING` is a special value that is always `False` at runtime but `True` during any \nkind of type checking or completion.\n\nOnce done, just code & enjoy.\n\n[pep-0484]: https://www.python.org/dev/peps/pep-0484/\n[pep-0561]: https://www.python.org/dev/peps/pep-0561/#stub-only-packages\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Ghidra Type Stubs",
"version": "11.3.post2",
"project_urls": null,
"split_keywords": [
"ghidra"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "22bb0131e88bfe1ec40c1b45883be1bcf59c4706ebc9486c35192b962666ea38",
"md5": "ab15b4289d9bc8505128ffcd13c60a83",
"sha256": "23fc1684208fdf8340b6b67b23fc1f85ff0854d8a82e57fabe7d99e1d2c1d384"
},
"downloads": -1,
"filename": "ghidra_stubs-11.3.post2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ab15b4289d9bc8505128ffcd13c60a83",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 2969506,
"upload_time": "2025-02-07T12:26:03",
"upload_time_iso_8601": "2025-02-07T12:26:03.902732Z",
"url": "https://files.pythonhosted.org/packages/22/bb/0131e88bfe1ec40c1b45883be1bcf59c4706ebc9486c35192b962666ea38/ghidra_stubs-11.3.post2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-07 12:26:03",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "ghidra-stubs"
}