{"id":13702521,"url":"https://github.com/hetznercloud/hcloud-python","last_synced_at":"2025-05-14T08:07:45.645Z","repository":{"id":34219785,"uuid":"162585627","full_name":"hetznercloud/hcloud-python","owner":"hetznercloud","description":"A Python library for the Hetzner Cloud API","archived":false,"fork":false,"pushed_at":"2025-04-25T09:54:07.000Z","size":1335,"stargazers_count":315,"open_issues_count":5,"forks_count":43,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-25T10:03:04.461Z","etag":null,"topics":["api","hcloud","hetzner","hetzner-cloud","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hetznercloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-12-20T13:48:22.000Z","updated_at":"2025-04-25T09:53:27.000Z","dependencies_parsed_at":"2024-01-04T13:40:08.728Z","dependency_job_id":"cd7a9b0d-23ee-416d-bc83-5b7cc7793f20","html_url":"https://github.com/hetznercloud/hcloud-python","commit_stats":{"total_commits":461,"total_committers":33,"mean_commits":"13.969696969696969","dds":0.7635574837310195,"last_synced_commit":"a9c179dc9655273d6570622fadad6e61abfa7812"},"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetznercloud%2Fhcloud-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetznercloud%2Fhcloud-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetznercloud%2Fhcloud-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetznercloud%2Fhcloud-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hetznercloud","download_url":"https://codeload.github.com/hetznercloud/hcloud-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101557,"owners_count":22014908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","hcloud","hetzner","hetzner-cloud","python"],"created_at":"2024-08-02T21:00:37.112Z","updated_at":"2025-05-14T08:07:44.245Z","avatar_url":"https://github.com/hetznercloud.png","language":"Python","funding_links":[],"categories":["Libraries","Python"],"sub_categories":["Python"],"readme":"# 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\u003e [!IMPORTANT]\n\u003e Make sure to follow our API changelog available at\n\u003e [docs.hetzner.cloud/changelog](https://docs.hetzner.cloud/changelog) (or the RSS feed\n\u003e available at\n\u003e [docs.hetzner.cloud/changelog/feed.rss](https://docs.hetzner.cloud/changelog/feed.rss))\n\u003e 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhetznercloud%2Fhcloud-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhetznercloud%2Fhcloud-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhetznercloud%2Fhcloud-python/lists"}