The `hcloud` library is the official Python client for interacting with the Hetzner Cloud API, enabling programmatic management of resources such as servers, networks, volumes, and more. It is actively maintained with frequent releases, currently at version 2.17.1, providing access to the latest Hetzner Cloud features and API updates.
pip install hcloudVerified import paths — ran on the pinned version, not inferred.
Initializes the Hetzner Cloud client using an API token from the `HCLOUD_TOKEN` environment variable and lists all available servers. This demonstrates basic client setup and interaction with resources.
Migrate your code to use `location` instead of `datacenter` when creating or managing Servers and Primary IPs. For example, `client.servers.create(location='fsn1', ...)` instead of `client.servers.create(datacenter='fsn1-dc14', ...)`.
Always check release notes and the `hcloud` documentation for new features. If using experimental features, pin to exact minor versions or be prepared for breaking changes until the feature is generally available.
Consult the library's changelog and docstrings. Update your code to use the recommended alternative method as indicated by `DeprecationWarning` messages or documentation.
Ensure the `HCLOUD_TOKEN` environment variable contains the *full* 64-character API token generated from the Hetzner Cloud console. Generate a new token if unsure.
Set the `HCLOUD_TOKEN` environment variable before running your Python script. Example: `export HCLOUD_TOKEN='your_api_token'` (Linux/macOS) or `$env:HCLOUD_TOKEN='your_api_token'` (PowerShell).
Carefully retype the problematic line of code, especially where API tokens or other string literals are defined, or use an editor with whitespace visualization to remove any hidden characters. Ensure your file encoding is UTF-8.
No dependency data recorded yet.