A Python SDK for Clever Cloud.
You can add it to your project using pip or uv:
pip install clevercloud-sdk
uv add clevercloud-sdkfrom clever_cloud import CleverCloudClient, ApiTokenCredentials
async with CleverCloudClient(ApiTokenCredentials(token="...")) as client:
profile = await client.get_profile()
print(f"Hello, {profile.name}!")You can also use OAuth credentials:
from clever_cloud import OAuthCredentials
credentials = OAuthCredentials(
consumer_key="...",
consumer_secret="...",
token="...",
secret="...",
)
async with CleverCloudClient(credentials) as client:
...The client accepts a custom CA bundle and a client certificate for mutual TLS, useful when targeting an API behind a private PKI or requiring client authentication:
async with CleverCloudClient(
credentials,
ca_bundle="/path/to/ca-bundle.pem",
client_cert=("/path/to/client.crt", "/path/to/client.key"),
) as client:
...verify_ssl=False disables server certificate verification entirely (not recommended outside of local testing).
This SDK is still a work in progress, but it already provides the following features:
- Get user profile
- List instance types
- Create application
- Redeploy application
- Create TCP redirection
- List domains
- Get primary domain
- Custom CA bundle and mTLS client certificate support
- Tolerant response handling (non-JSON bodies, relaxed
Acceptheader) - NetworkGroups: create / get / delete / search, manage members, peers and external peers
Attach an application as a member of an existing NetworkGroup:
from clever_cloud import MemberKind
await client.create_networkgroup_member(
owner_id="orga_xxx",
ng_id="ng_xxx",
member_id="app_xxx",
domain_name="my-app.m.ng_xxx.members",
kind=MemberKind.APPLICATION,
label="my-app",
)Apache 2.0 - See LICENSE for details.