Skip to main content

OpenAPI spec for ClickHouse Cloud SDK

Built with APIMatic License: MIT Python 3.10+

The OpenAPI spec for ClickHouse Cloud SDK for Python provides access to the OpenAPI spec for ClickHouse Cloud REST APIs from Python applications.


Installation

Install the Python SDK from PyPI, with whichever package manager your project uses:

pip install ch-apimatic-sdk
uv add ch-apimatic-sdk
poetry add ch-apimatic-sdk

Quick Start

Synchronous client

Construct OpenApiSpecForClickHouseCloudClient with keyword arguments, and call close() when you are done. Every argument is optional; the full list is in the SDK map.

from open_api_spec_for_click_house_cloud import OpenApiSpecForClickHouseCloudClient
from open_api_spec_for_click_house_cloud.core import BasicAuthCredentials

client = OpenApiSpecForClickHouseCloudClient(
    basic_auth=BasicAuthCredentials(username="YOUR_USERNAME", password="YOUR_PASSWORD")
)

# TODO: call endpoints here -- see api-reference.md

client.close()

Alternatively, scope it -- with OpenApiSpecForClickHouseCloudClient(...) as client: closes the pool on exit; see Best Practices.

Client is exported as an alias of OpenApiSpecForClickHouseCloudClient, so from open_api_spec_for_click_house_cloud import Client also works.

The SDK accepts every model-typed input in two interchangeable spellings, both type-checked: the typed model, or a plain dict with the same keys -- the OrDict and Model | ModelDict unions in the SDK map. Pick whichever suits the call site: the dict form needs no import, while the model form adds a keyword-checked constructor and editor completion.

Asynchronous client

AsyncOpenApiSpecForClickHouseCloudClient mirrors OpenApiSpecForClickHouseCloudClient with identical method names, and every endpoint method is a coroutine. It takes the same arguments, with some differences -- for example, the transport argument is custom_async_http_client.

from asyncio import run

from open_api_spec_for_click_house_cloud import AsyncOpenApiSpecForClickHouseCloudClient
from open_api_spec_for_click_house_cloud.core import BasicAuthCredentials


async def main() -> None:
    client = AsyncOpenApiSpecForClickHouseCloudClient(
        basic_auth=BasicAuthCredentials(username="YOUR_USERNAME", password="YOUR_PASSWORD")
    )
    # TODO: call endpoints here, awaiting each -- see api-reference.md
    await client.aclose()


run(main())

Alternatively, scope it -- async with AsyncOpenApiSpecForClickHouseCloudClient(...) as client: closes the pool on exit. Only the async spelling is aclose, matching httpx; see Best Practices.

AsyncClient is the exported alias. Each client accepts only its own transport argument; passing the other's is a TypeError at runtime and an error under mypy.


Usage

Two generated references cover the SDK; each answers a different question:

Reference For
API Reference Usage guidance for a single parsed operation: client.<group>.<operation>(...) returns the typed payload and raises ApiError on any non-2xx, with .error the typed error body, or RawError for a status the operation does not document.
Raw API Reference The same for the raw variant: client.<group>.with_raw_response.<operation>(...) returns ApiResult[T, E] and never raises for an API error.

Both API references carry every one of the 157 operations, with a sync and an async sample and a parameter table each.

SDK map

This SDK ships a generated SDK map -- sdk-map.md -- a deterministic, lookup-oriented table of contents of the SDK's Python surface, generated by APIMatic alongside this SDK.

Consult the map before scanning or grepping the source: it answers call-level contract questions by lookup, and for anything it does not carry -- model shapes, enum values, an endpoint's route or behavioural prose -- it names the one source file to read. How to read the map itself, including the SDK-wide defaults its rows rely on, is stated at the top of sdk-map.md.

Best Practices

Match the disposal to the client's lifetime: an application-lifetime client is closed once at shutdown with close() / aclose(); where the lifetime fits a block, with OpenApiSpecForClickHouseCloudClient() as client: / async with AsyncOpenApiSpecForClickHouseCloudClient() as client: releases it automatically. Both are idempotent, but a closed client is not reusable: the next call raises. The client closes whatever transport it holds, including one you supplied via custom_http_client / custom_async_http_client; if you intend to reuse your own transport across clients, don't hand its lifetime to a with block.

License

This SDK is distributed under the MIT License.


Support

Refer to the API reference for detailed information on available operations with code samples.

For further assistance, please contact support at support@clickhouse.com.


Metadata

Release files for ch-apimatic-sdk 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ch-apimatic-sdk 0.0.2
File Size Uploaded Provenance Actions
ch_apimatic_sdk-0.0.2.tar.gz 335.9 kB Without provenance Details for ch_apimatic_sdk-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ch-apimatic-sdk 0.0.2
File Interpreter ABI Platform Actions
ch_apimatic_sdk-0.0.2-py3-none-any.whl Python 3 none any Details for ch_apimatic_sdk-0.0.2-py3-none-any.whl

Total release size: 1.4 MB

Release files / ch_apimatic_sdk-0.0.2.tar.gz

Download URL ch_apimatic_sdk-0.0.2.tar.gz
Size 335.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a4e1d26f981b96cf870b9900693c326072a42b59d27ce7163faf56f21909a765
BLAKE2b-256 checksum
How to use checksums
3bb84c337987ed2f0b6a88b6b6a242e1d317cc3c7d98996b6c1ef628c4cf1add
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.13.15 Linux/6.1.158.2-microsoft-standard

Release files / ch_apimatic_sdk-0.0.2-py3-none-any.whl

Download URL ch_apimatic_sdk-0.0.2-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c9d80a5dcb6f8c9ce4d1ed332370090ebe9780561eeac300e4941b8f1ff77680
BLAKE2b-256 checksum
How to use checksums
1daf3d4cac4580c8b72c7e1d06323bf25d83a8bd704cde76da5a2ddd1f5762de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.13.15 Linux/6.1.158.2-microsoft-standard

Security for ch-apimatic-sdk 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page