The `ovh` Python library is the official module for interacting with OVHcloud APIs. It provides a thin wrapper that handles the complexities of credential creation and request signing. The library is currently at version 1.2.0 and is actively maintained, with new releases incorporating features and compatibility updates for modern Python versions. It is designed to simplify automation and management of OVHcloud services.
pip install ovhVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the OVHcloud API client using environment variables for credentials (recommended for security). It then makes a simple call to retrieve the current user's information. Replace placeholder keys with your actual OVHcloud Application Key, Application Secret, and Consumer Key. Remember to obtain your Consumer Key via the OVHcloud API console or the `request_consumerkey` helper after creating your application.
Upgrade your Python environment to 3.7+ or pin the library version to `ovh~=0.6.0` if unable to upgrade Python.
Pass Python dictionaries or keyword arguments directly to `client.post()` or `client.put()`. The library handles the JSON serialization.
Store `application_key`, `application_secret`, and `consumer_key` in an `ovh.conf` file in your working directory or as environment variables (e.g., `OVH_APPLICATION_KEY`). The client automatically reads these if not provided explicitly.
For scripts requiring user authorization, implement the `request_consumerkey` flow. For personal use or pre-authorized applications, ensure the CK is valid and has the necessary permissions. Visit `https://api.ovh.com/createToken/` to manage application and consumer keys.