hcloud


Namehcloud JSON
Version 2.5.4 PyPI version JSON
download
home_pagehttps://github.com/hetznercloud/hcloud-python
SummaryOfficial Hetzner Cloud python library
upload_time2025-07-09 09:52:01
maintainerNone
docs_urlNone
authorHetzner Cloud GmbH
requires_python>=3.9
licenseMIT
keywords hcloud hetzner cloud
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Hetzner Cloud Python

[![](https://github.com/hetznercloud/hcloud-python/actions/workflows/test.yml/badge.svg)](https://github.com/hetznercloud/hcloud-python/actions/workflows/test.yml)
[![](https://github.com/hetznercloud/hcloud-python/actions/workflows/lint.yml/badge.svg)](https://github.com/hetznercloud/hcloud-python/actions/workflows/lint.yml)
[![](https://codecov.io/github/hetznercloud/hcloud-python/graph/badge.svg?token=3YGRqB5t1L)](https://codecov.io/github/hetznercloud/hcloud-python/tree/main)
[![](https://readthedocs.org/projects/hcloud-python/badge/?version=latest)](https://hcloud-python.readthedocs.io)
[![](https://img.shields.io/pypi/pyversions/hcloud.svg)](https://pypi.org/project/hcloud/)

Official Hetzner Cloud python library.

The library's documentation is available at [hcloud-python.readthedocs.io](https://hcloud-python.readthedocs.io), the public API documentation is available at [docs.hetzner.cloud](https://docs.hetzner.cloud).

> [!IMPORTANT]
> Make sure to follow our API changelog available at
> [docs.hetzner.cloud/changelog](https://docs.hetzner.cloud/changelog) (or the RSS feed
> available at
> [docs.hetzner.cloud/changelog/feed.rss](https://docs.hetzner.cloud/changelog/feed.rss))
> to be notified about additions, deprecations and removals.

## Usage

Install the `hcloud` library:

```sh
pip install hcloud
```

For more installation details, please see the [installation docs](https://hcloud-python.readthedocs.io/en/stable/installation.html).

Here is an example that creates a server and list them:

```python
from hcloud import Client
from hcloud.images import Image
from hcloud.server_types import ServerType

client = Client(token="{YOUR_API_TOKEN}")  # Please paste your API token here

# Create a server named my-server
response = client.servers.create(
    name="my-server",
    server_type=ServerType(name="cx22"),
    image=Image(name="ubuntu-22.04"),
)
server = response.server
print(f"{server.id=} {server.name=} {server.status=}")
print(f"root password: {response.root_password}")

# List your servers
servers = client.servers.get_all()
for server in servers:
    print(f"{server.id=} {server.name=} {server.status=}")
```

- To upgrade the package, please read the [instructions available in the documentation](https://hcloud-python.readthedocs.io/en/stable/upgrading.html).
- For more details on the API, please see the [API reference](https://hcloud-python.readthedocs.io/en/stable/api.html).
- You can find some more examples under the [`examples/`](https://github.com/hetznercloud/hcloud-python/tree/main/examples) directory.

## Supported Python versions

We support python versions until [`end-of-life`](https://devguide.python.org/versions/#status-of-python-versions).

## Development

First, create a virtual environment and activate it:

```sh
make venv
source venv/bin/activate
```

You may setup [`pre-commit`](https://pre-commit.com/) to run before you commit changes, this removes the need to run it manually afterwards:

```sh
pre-commit install
```

You can then run different tasks defined in the `Makefile`, below are the most important ones:

Build the documentation and open it in your browser:

```sh
make docs
```

Lint the code:

```sh
make lint
```

Run tests using the current `python3` version:

```sh
make test
```

You may also run the tests for multiple `python3` versions using `tox`:

```sh
tox .
```

### Deprecations implementation

When deprecating a module or a function, you must:

- Update the docstring with a `deprecated` notice:

```py
"""Get image by name

.. deprecated:: 1.19
    Use :func:`hcloud.images.client.ImagesClient.get_by_name_and_architecture` instead.
"""
```

- Raise a warning when the deprecated module or function is being used:

```py
warnings.warn(
    "The 'hcloud.images.client.ImagesClient.get_by_name' method is deprecated, please use the "
    "'hcloud.images.client.ImagesClient.get_by_name_and_architecture' method instead.",
    DeprecationWarning,
    stacklevel=2,
)
```

## License

The MIT License (MIT). Please see [`License File`](https://github.com/hetznercloud/hcloud-python/blob/main/LICENSE) for more information.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hetznercloud/hcloud-python",
    "name": "hcloud",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "hcloud hetzner cloud",
    "author": "Hetzner Cloud GmbH",
    "author_email": "support-cloud@hetzner.com",
    "download_url": "https://files.pythonhosted.org/packages/b3/68/89fe80bccc47c46943120c8cb232289645f5d0cdfb0a93d5e8ad09ec2ffe/hcloud-2.5.4.tar.gz",
    "platform": null,
    "description": "# Hetzner Cloud Python\n\n[![](https://github.com/hetznercloud/hcloud-python/actions/workflows/test.yml/badge.svg)](https://github.com/hetznercloud/hcloud-python/actions/workflows/test.yml)\n[![](https://github.com/hetznercloud/hcloud-python/actions/workflows/lint.yml/badge.svg)](https://github.com/hetznercloud/hcloud-python/actions/workflows/lint.yml)\n[![](https://codecov.io/github/hetznercloud/hcloud-python/graph/badge.svg?token=3YGRqB5t1L)](https://codecov.io/github/hetznercloud/hcloud-python/tree/main)\n[![](https://readthedocs.org/projects/hcloud-python/badge/?version=latest)](https://hcloud-python.readthedocs.io)\n[![](https://img.shields.io/pypi/pyversions/hcloud.svg)](https://pypi.org/project/hcloud/)\n\nOfficial Hetzner Cloud python library.\n\nThe library's documentation is available at [hcloud-python.readthedocs.io](https://hcloud-python.readthedocs.io), the public API documentation is available at [docs.hetzner.cloud](https://docs.hetzner.cloud).\n\n> [!IMPORTANT]\n> Make sure to follow our API changelog available at\n> [docs.hetzner.cloud/changelog](https://docs.hetzner.cloud/changelog) (or the RSS feed\n> available at\n> [docs.hetzner.cloud/changelog/feed.rss](https://docs.hetzner.cloud/changelog/feed.rss))\n> to be notified about additions, deprecations and removals.\n\n## Usage\n\nInstall the `hcloud` library:\n\n```sh\npip install hcloud\n```\n\nFor more installation details, please see the [installation docs](https://hcloud-python.readthedocs.io/en/stable/installation.html).\n\nHere is an example that creates a server and list them:\n\n```python\nfrom hcloud import Client\nfrom hcloud.images import Image\nfrom hcloud.server_types import ServerType\n\nclient = Client(token=\"{YOUR_API_TOKEN}\")  # Please paste your API token here\n\n# Create a server named my-server\nresponse = client.servers.create(\n    name=\"my-server\",\n    server_type=ServerType(name=\"cx22\"),\n    image=Image(name=\"ubuntu-22.04\"),\n)\nserver = response.server\nprint(f\"{server.id=} {server.name=} {server.status=}\")\nprint(f\"root password: {response.root_password}\")\n\n# List your servers\nservers = client.servers.get_all()\nfor server in servers:\n    print(f\"{server.id=} {server.name=} {server.status=}\")\n```\n\n- To upgrade the package, please read the [instructions available in the documentation](https://hcloud-python.readthedocs.io/en/stable/upgrading.html).\n- For more details on the API, please see the [API reference](https://hcloud-python.readthedocs.io/en/stable/api.html).\n- You can find some more examples under the [`examples/`](https://github.com/hetznercloud/hcloud-python/tree/main/examples) directory.\n\n## Supported Python versions\n\nWe support python versions until [`end-of-life`](https://devguide.python.org/versions/#status-of-python-versions).\n\n## Development\n\nFirst, create a virtual environment and activate it:\n\n```sh\nmake venv\nsource venv/bin/activate\n```\n\nYou may setup [`pre-commit`](https://pre-commit.com/) to run before you commit changes, this removes the need to run it manually afterwards:\n\n```sh\npre-commit install\n```\n\nYou can then run different tasks defined in the `Makefile`, below are the most important ones:\n\nBuild the documentation and open it in your browser:\n\n```sh\nmake docs\n```\n\nLint the code:\n\n```sh\nmake lint\n```\n\nRun tests using the current `python3` version:\n\n```sh\nmake test\n```\n\nYou may also run the tests for multiple `python3` versions using `tox`:\n\n```sh\ntox .\n```\n\n### Deprecations implementation\n\nWhen deprecating a module or a function, you must:\n\n- Update the docstring with a `deprecated` notice:\n\n```py\n\"\"\"Get image by name\n\n.. deprecated:: 1.19\n    Use :func:`hcloud.images.client.ImagesClient.get_by_name_and_architecture` instead.\n\"\"\"\n```\n\n- Raise a warning when the deprecated module or function is being used:\n\n```py\nwarnings.warn(\n    \"The 'hcloud.images.client.ImagesClient.get_by_name' method is deprecated, please use the \"\n    \"'hcloud.images.client.ImagesClient.get_by_name_and_architecture' method instead.\",\n    DeprecationWarning,\n    stacklevel=2,\n)\n```\n\n## License\n\nThe MIT License (MIT). Please see [`License File`](https://github.com/hetznercloud/hcloud-python/blob/main/LICENSE) for more information.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Official Hetzner Cloud python library",
    "version": "2.5.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/hetznercloud/hcloud-python/issues",
        "Changelog": "https://github.com/hetznercloud/hcloud-python/blob/main/CHANGELOG.md",
        "Documentation": "https://hcloud-python.readthedocs.io/en/stable/",
        "Homepage": "https://github.com/hetznercloud/hcloud-python",
        "Source Code": "https://github.com/hetznercloud/hcloud-python"
    },
    "split_keywords": [
        "hcloud",
        "hetzner",
        "cloud"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1cd8cddd1e1e42742527fc8d7d47cd8d7827176e1157c609e0e77bccb8583593",
                "md5": "950aba2bdacc60f84514f81c3da37c18",
                "sha256": "a6b23104bfaaa1507dd222604f1bcb6e89601c26d0447f0b84a4cf8a808a9c73"
            },
            "downloads": -1,
            "filename": "hcloud-2.5.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "950aba2bdacc60f84514f81c3da37c18",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 88330,
            "upload_time": "2025-07-09T09:52:00",
            "upload_time_iso_8601": "2025-07-09T09:52:00.309261Z",
            "url": "https://files.pythonhosted.org/packages/1c/d8/cddd1e1e42742527fc8d7d47cd8d7827176e1157c609e0e77bccb8583593/hcloud-2.5.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b36889fe80bccc47c46943120c8cb232289645f5d0cdfb0a93d5e8ad09ec2ffe",
                "md5": "9c59f60c11c601695726cfb28b172d0f",
                "sha256": "2532e0d8b6e20fb5a90af5f8d36eb0039a197c2094d1d56fc7fce789a300025e"
            },
            "downloads": -1,
            "filename": "hcloud-2.5.4.tar.gz",
            "has_sig": false,
            "md5_digest": "9c59f60c11c601695726cfb28b172d0f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 125742,
            "upload_time": "2025-07-09T09:52:01",
            "upload_time_iso_8601": "2025-07-09T09:52:01.789287Z",
            "url": "https://files.pythonhosted.org/packages/b3/68/89fe80bccc47c46943120c8cb232289645f5d0cdfb0a93d5e8ad09ec2ffe/hcloud-2.5.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-09 09:52:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hetznercloud",
    "github_project": "hcloud-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "hcloud"
}
        
Elapsed time: 2.03839s