![Greenbone Logo](https://www.greenbone.net/wp-content/uploads/gb_new-logo_horizontal_rgb_small.png)
# Greenbone Vulnerability Management Python Library <!-- omit in toc -->
[![GitHub releases](https://img.shields.io/github/release-pre/greenbone/python-gvm.svg)](https://github.com/greenbone/python-gvm/releases)
[![PyPI release](https://img.shields.io/pypi/v/python-gvm.svg)](https://pypi.org/project/python-gvm/)
[![code test coverage](https://codecov.io/gh/greenbone/python-gvm/branch/main/graph/badge.svg)](https://codecov.io/gh/greenbone/python-gvm)
[![Build and test](https://github.com/greenbone/python-gvm/actions/workflows/ci.yml/badge.svg)](https://github.com/greenbone/python-gvm/actions/workflows/ci.yml)
The Greenbone Vulnerability Management Python API library (**python-gvm**) is a
collection of APIs that help with remote controlling Greenbone Community Edition
installations and Greenbone Enterprise Appliances. The library essentially
abstracts accessing the communication protocols Greenbone Management Protocol
(GMP) and Open Scanner Protocol (OSP).
## Table of Contents <!-- omit in toc -->
- [Documentation](#documentation)
- [Installation](#installation)
- [Version](#version)
- [Requirements](#requirements)
- [Install using pip](#install-using-pip)
- [Example](#example)
- [Support](#support)
- [Maintainer](#maintainer)
- [Contributing](#contributing)
- [License](#license)
## Documentation
The documentation for python-gvm can be found at
[https://greenbone.github.io/python-gvm/](https://greenbone.github.io/python-gvm/).
Please always take a look at the documentation for further details. This
**README** just gives you a short overview.
## Installation
### Version
Please consider to always use the **newest** version of `gvm-tools` and `python-gvm`.
We frequently update this projects to add features and keep them free from bugs.
This is why installing `python-gvm` using pip is recommended.
> [!IMPORTANT]
> To use `python-gvm` with GMP version of 7, 8 or 9 you must use a release version
> that is `<21.5`. In the `21.5` release the support of these versions has been
> dropped.
> [!IMPORTANT]
> To use `python-gvm` with GMP version 20.8 or 21.4 you must use a release version
> that is `<24.6`. In the `24.6` release the support of these versions has been
> dropped.
### Requirements
Python 3.9 and later is supported.
### Install using pip
You can install the latest stable release of python-gvm from the Python Package
Index using [pip](https://pip.pypa.io/):
python3 -m pip install --user python-gvm
## Example
```python3
from gvm.connections import UnixSocketConnection
from gvm.protocols.gmp import Gmp
from gvm.transforms import EtreeTransform
from gvm.xml import pretty_print
connection = UnixSocketConnection()
transform = EtreeTransform()
with Gmp(connection, transform=transform) as gmp:
# Retrieve GMP version supported by the remote daemon
version = gmp.get_version()
# Prints the XML in beautiful form
pretty_print(version)
# Login
gmp.authenticate('foo', 'bar')
# Retrieve all tasks
tasks = gmp.get_tasks()
# Get names of tasks
task_names = tasks.xpath('task/name/text()')
pretty_print(task_names)
```
## Support
For any question on the usage of python-gvm please use the
[Greenbone Community Forum](https://forum.greenbone.net/c/building-from-source-under-the-hood/gmp/11). If you
found a problem with the software, please
[create an issue](https://github.com/greenbone/python-gvm/issues)
on GitHub.
## Maintainer
This project is maintained by [Greenbone AG](https://www.greenbone.net/).
## Contributing
Your contributions are highly appreciated. Please
[create a pull request](https://github.com/greenbone/python-gvm/pulls) on GitHub.
For bigger changes, please discuss it first in the
[issues](https://github.com/greenbone/python-gvm/issues).
For development you should use [poetry](https://python-poetry.org)
to keep you python packages separated in different environments. First install
poetry via pip
```shell
python3 -m pip install --user poetry
```
Afterwards run
```shell
poetry install
```
in the checkout directory of python-gvm (the directory containing the
`pyproject.toml` file) to install all dependencies including the packages only
required for development.
The python-gvm repository uses [autohooks](https://github.com/greenbone/autohooks)
to apply linting and auto formatting via git hooks. Please ensure the git hooks
are active.
$ poetry install
$ poetry run autohooks activate --force
## License
Copyright (C) 2017-2024 [Greenbone AG](https://www.greenbone.net/)
Licensed under the [GNU General Public License v3.0 or later](LICENSE).
Raw data
{
"_id": null,
"home_page": "https://github.com/greenbone/python-gvm/",
"name": "python-gvm",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Greenbone AG",
"author_email": "info@greenbone.net",
"download_url": "https://files.pythonhosted.org/packages/82/ab/87cc5cc7977465eb66469a6c9efefadfa439bf56c25c41d00134aace8878/python_gvm-24.8.0.tar.gz",
"platform": null,
"description": "![Greenbone Logo](https://www.greenbone.net/wp-content/uploads/gb_new-logo_horizontal_rgb_small.png)\n\n# Greenbone Vulnerability Management Python Library <!-- omit in toc -->\n\n[![GitHub releases](https://img.shields.io/github/release-pre/greenbone/python-gvm.svg)](https://github.com/greenbone/python-gvm/releases)\n[![PyPI release](https://img.shields.io/pypi/v/python-gvm.svg)](https://pypi.org/project/python-gvm/)\n[![code test coverage](https://codecov.io/gh/greenbone/python-gvm/branch/main/graph/badge.svg)](https://codecov.io/gh/greenbone/python-gvm)\n[![Build and test](https://github.com/greenbone/python-gvm/actions/workflows/ci.yml/badge.svg)](https://github.com/greenbone/python-gvm/actions/workflows/ci.yml)\n\nThe Greenbone Vulnerability Management Python API library (**python-gvm**) is a\ncollection of APIs that help with remote controlling Greenbone Community Edition\ninstallations and Greenbone Enterprise Appliances. The library essentially\nabstracts accessing the communication protocols Greenbone Management Protocol\n(GMP) and Open Scanner Protocol (OSP).\n\n## Table of Contents <!-- omit in toc -->\n\n- [Documentation](#documentation)\n- [Installation](#installation)\n - [Version](#version)\n - [Requirements](#requirements)\n - [Install using pip](#install-using-pip)\n- [Example](#example)\n- [Support](#support)\n- [Maintainer](#maintainer)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Documentation\n\nThe documentation for python-gvm can be found at\n[https://greenbone.github.io/python-gvm/](https://greenbone.github.io/python-gvm/).\nPlease always take a look at the documentation for further details. This\n**README** just gives you a short overview.\n\n## Installation\n\n### Version\n\nPlease consider to always use the **newest** version of `gvm-tools` and `python-gvm`.\nWe frequently update this projects to add features and keep them free from bugs.\nThis is why installing `python-gvm` using pip is recommended.\n\n> [!IMPORTANT]\n> To use `python-gvm` with GMP version of 7, 8 or 9 you must use a release version\n> that is `<21.5`. In the `21.5` release the support of these versions has been\n> dropped.\n\n> [!IMPORTANT]\n> To use `python-gvm` with GMP version 20.8 or 21.4 you must use a release version\n> that is `<24.6`. In the `24.6` release the support of these versions has been\n> dropped.\n\n### Requirements\n\nPython 3.9 and later is supported.\n\n### Install using pip\n\nYou can install the latest stable release of python-gvm from the Python Package\nIndex using [pip](https://pip.pypa.io/):\n\n python3 -m pip install --user python-gvm\n\n## Example\n\n```python3\nfrom gvm.connections import UnixSocketConnection\nfrom gvm.protocols.gmp import Gmp\nfrom gvm.transforms import EtreeTransform\nfrom gvm.xml import pretty_print\n\nconnection = UnixSocketConnection()\ntransform = EtreeTransform()\n\nwith Gmp(connection, transform=transform) as gmp:\n # Retrieve GMP version supported by the remote daemon\n version = gmp.get_version()\n\n # Prints the XML in beautiful form\n pretty_print(version)\n\n # Login\n gmp.authenticate('foo', 'bar')\n\n # Retrieve all tasks\n tasks = gmp.get_tasks()\n\n # Get names of tasks\n task_names = tasks.xpath('task/name/text()')\n pretty_print(task_names)\n```\n\n## Support\n\nFor any question on the usage of python-gvm please use the\n[Greenbone Community Forum](https://forum.greenbone.net/c/building-from-source-under-the-hood/gmp/11). If you\nfound a problem with the software, please\n[create an issue](https://github.com/greenbone/python-gvm/issues)\non GitHub.\n\n## Maintainer\n\nThis project is maintained by [Greenbone AG](https://www.greenbone.net/).\n\n## Contributing\n\nYour contributions are highly appreciated. Please\n[create a pull request](https://github.com/greenbone/python-gvm/pulls) on GitHub.\nFor bigger changes, please discuss it first in the\n[issues](https://github.com/greenbone/python-gvm/issues).\n\nFor development you should use [poetry](https://python-poetry.org)\nto keep you python packages separated in different environments. First install\npoetry via pip\n\n```shell\npython3 -m pip install --user poetry\n```\n\nAfterwards run\n\n```shell\npoetry install\n```\n\nin the checkout directory of python-gvm (the directory containing the\n`pyproject.toml` file) to install all dependencies including the packages only\nrequired for development.\n\nThe python-gvm repository uses [autohooks](https://github.com/greenbone/autohooks)\nto apply linting and auto formatting via git hooks. Please ensure the git hooks\nare active.\n\n $ poetry install\n $ poetry run autohooks activate --force\n\n## License\n\nCopyright (C) 2017-2024 [Greenbone AG](https://www.greenbone.net/)\n\nLicensed under the [GNU General Public License v3.0 or later](LICENSE).\n\n",
"bugtrack_url": null,
"license": "GPL-3.0-or-later",
"summary": "Library to communicate with remote servers over GMP or OSP",
"version": "24.8.0",
"project_urls": {
"Documentation": "https://greenbone.github.io/python-gvm/",
"Homepage": "https://github.com/greenbone/python-gvm/",
"Repository": "https://github.com/greenbone/python-gvm/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5ae9751c6dc4e68771f04e1e4f52d002e5e631c2b6a5b1929a18f07e53724d46",
"md5": "0cc394925ab6af8cc039afc7915d81fc",
"sha256": "629845ba563f7d1ddf76795c4689f3d9e04af5e20c77d4f8621062be9fcc5f28"
},
"downloads": -1,
"filename": "python_gvm-24.8.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0cc394925ab6af8cc039afc7915d81fc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 129130,
"upload_time": "2024-08-29T12:44:09",
"upload_time_iso_8601": "2024-08-29T12:44:09.201118Z",
"url": "https://files.pythonhosted.org/packages/5a/e9/751c6dc4e68771f04e1e4f52d002e5e631c2b6a5b1929a18f07e53724d46/python_gvm-24.8.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "82ab87cc5cc7977465eb66469a6c9efefadfa439bf56c25c41d00134aace8878",
"md5": "19cb5c641cbd3fb38cf5eabae34274cd",
"sha256": "35b66b90aa41648ca78bd8d763fe811bc282697aecb1c2353a7a2cfdd23c1b9a"
},
"downloads": -1,
"filename": "python_gvm-24.8.0.tar.gz",
"has_sig": false,
"md5_digest": "19cb5c641cbd3fb38cf5eabae34274cd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 190379,
"upload_time": "2024-08-29T12:44:10",
"upload_time_iso_8601": "2024-08-29T12:44:10.553733Z",
"url": "https://files.pythonhosted.org/packages/82/ab/87cc5cc7977465eb66469a6c9efefadfa439bf56c25c41d00134aace8878/python_gvm-24.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-29 12:44:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "greenbone",
"github_project": "python-gvm",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "python-gvm"
}