|
1 | 1 | # hotdata |
2 | | -Powerful data platform API for datasets, queries, and analytics. |
3 | 2 |
|
4 | | -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: |
| 3 | +Official Python client for the [Hotdata](https://app.hotdata.dev) HTTP API: workspaces, connections, datasets, SQL queries, results, secrets, uploads, indexes, jobs, embedding providers, and workspace context. |
5 | 4 |
|
6 | | -- API version: 1.0.0 |
7 | | -- Package version: 1.0.0 |
8 | | -- Generator version: 7.20.0 |
9 | | -- Build package: org.openapitools.codegen.languages.PythonClientCodegen |
| 5 | +The package is produced with [OpenAPI Generator](https://openapi-generator.tech) from the Hotdata OpenAPI spec. Regenerate via the **Regenerate Client** workflow in this repository when the API changes. |
10 | 6 |
|
11 | | -## Requirements. |
| 7 | +## Requirements |
12 | 8 |
|
13 | 9 | Python 3.9+ |
14 | 10 |
|
15 | | -## Installation & Usage |
16 | | -### pip install |
| 11 | +## Install |
17 | 12 |
|
18 | | -If the python package is hosted on a repository, you can install directly using: |
| 13 | +From the repository: |
19 | 14 |
|
20 | 15 | ```sh |
21 | | -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git |
| 16 | +pip install "git+https://github.com/hotdata-dev/sdk-python.git" |
22 | 17 | ``` |
23 | | -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) |
24 | 18 |
|
25 | | -Then import the package: |
26 | | -```python |
27 | | -import hotdata |
28 | | -``` |
| 19 | +From a local checkout (editable): |
29 | 20 |
|
30 | | -### Setuptools |
| 21 | +```sh |
| 22 | +pip install -e . |
| 23 | +``` |
31 | 24 |
|
32 | | -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). |
| 25 | +## Tests |
33 | 26 |
|
34 | 27 | ```sh |
35 | | -python setup.py install --user |
| 28 | +pytest |
36 | 29 | ``` |
37 | | -(or `sudo python setup.py install` to install the package for all users) |
38 | 30 |
|
39 | | -Then import the package: |
| 31 | +## Authentication |
| 32 | + |
| 33 | +The API uses **Bearer** JWTs and an **`X-Workspace-Id`** header on requests that are scoped to a workspace. |
| 34 | + |
40 | 35 | ```python |
41 | 36 | import hotdata |
42 | | -``` |
43 | 37 |
|
44 | | -### Tests |
45 | | - |
46 | | -Execute `pytest` to run the tests. |
| 38 | +configuration = hotdata.Configuration( |
| 39 | + access_token="YOUR_ACCESS_TOKEN", |
| 40 | + api_key={"WorkspaceId": "YOUR_WORKSPACE_ID"}, |
| 41 | +) |
| 42 | +``` |
47 | 43 |
|
48 | | -## Getting Started |
| 44 | +`host` defaults to `https://app.hotdata.dev`. Override it if you target another environment. |
49 | 45 |
|
50 | | -Please follow the [installation procedure](#installation--usage) and then run the following: |
| 46 | +## Usage |
51 | 47 |
|
52 | 48 | ```python |
53 | | - |
54 | 49 | import hotdata |
55 | 50 | from hotdata.rest import ApiException |
56 | | -from pprint import pprint |
57 | 51 |
|
58 | | -# Defining the host is optional and defaults to https://app.hotdata.dev |
59 | | -# See configuration.py for a list of all supported configuration parameters. |
60 | 52 | configuration = hotdata.Configuration( |
61 | | - host = "https://app.hotdata.dev" |
| 53 | + access_token="YOUR_ACCESS_TOKEN", |
| 54 | + api_key={"WorkspaceId": "YOUR_WORKSPACE_ID"}, |
62 | 55 | ) |
63 | 56 |
|
64 | | - |
65 | | - |
66 | | -# Enter a context with an instance of the API client |
67 | 57 | with hotdata.ApiClient(configuration) as api_client: |
68 | | - # Create an instance of the API class |
69 | | - api_instance = hotdata.ConnectionsApi(api_client) |
70 | | - connection_id = 'connection_id_example' # str | Connection ID |
71 | | - |
| 58 | + workspaces = hotdata.WorkspacesApi(api_client) |
72 | 59 | try: |
73 | | - # Check connection health |
74 | | - api_response = api_instance.check_connection_health_handler(connection_id) |
75 | | - print("The response of ConnectionsApi->check_connection_health_handler:\n") |
76 | | - pprint(api_response) |
| 60 | + response = workspaces.list_workspaces() |
77 | 61 | except ApiException as e: |
78 | | - print("Exception when calling ConnectionsApi->check_connection_health_handler: %s\n" % e) |
79 | | - |
| 62 | + print(f"API error: {e.status} {e.reason}\n{e.body}") |
80 | 63 | ``` |
81 | 64 |
|
82 | | -## Documentation for API Endpoints |
83 | | - |
84 | | -All URIs are relative to *https://app.hotdata.dev* |
85 | | - |
86 | | -Class | Method | HTTP request | Description |
87 | | ------------- | ------------- | ------------- | ------------- |
88 | | -*ConnectionsApi* | [**check_connection_health_handler**](docs/ConnectionsApi.md#check_connection_health_handler) | **GET** /v1/connections/{connection_id}/health | Check connection health |
89 | | -*ConnectionsApi* | [**create_connection_handler**](docs/ConnectionsApi.md#create_connection_handler) | **POST** /v1/connections | Create connection |
90 | | -*ConnectionsApi* | [**delete_connection_handler**](docs/ConnectionsApi.md#delete_connection_handler) | **DELETE** /v1/connections/{connection_id} | Delete connection |
91 | | -*ConnectionsApi* | [**get_connection_handler**](docs/ConnectionsApi.md#get_connection_handler) | **GET** /v1/connections/{connection_id} | Get connection |
92 | | -*ConnectionsApi* | [**get_table_profile_handler**](docs/ConnectionsApi.md#get_table_profile_handler) | **GET** /v1/connections/{connection_id}/tables/{schema}/{table}/profile | Get table profile |
93 | | -*ConnectionsApi* | [**list_connections_handler**](docs/ConnectionsApi.md#list_connections_handler) | **GET** /v1/connections | List connections |
94 | | -*ConnectionsApi* | [**purge_connection_cache_handler**](docs/ConnectionsApi.md#purge_connection_cache_handler) | **DELETE** /v1/connections/{connection_id}/cache | Purge connection cache |
95 | | -*ConnectionsApi* | [**purge_table_cache_handler**](docs/ConnectionsApi.md#purge_table_cache_handler) | **DELETE** /v1/connections/{connection_id}/tables/{schema}/{table}/cache | Purge table cache |
96 | | -*DatasetsApi* | [**create_dataset**](docs/DatasetsApi.md#create_dataset) | **POST** /v1/datasets | Create dataset |
97 | | -*DatasetsApi* | [**delete_dataset**](docs/DatasetsApi.md#delete_dataset) | **DELETE** /v1/datasets/{id} | Delete dataset |
98 | | -*DatasetsApi* | [**get_dataset**](docs/DatasetsApi.md#get_dataset) | **GET** /v1/datasets/{id} | Get dataset |
99 | | -*DatasetsApi* | [**list_datasets**](docs/DatasetsApi.md#list_datasets) | **GET** /v1/datasets | List datasets |
100 | | -*DatasetsApi* | [**update_dataset**](docs/DatasetsApi.md#update_dataset) | **PUT** /v1/datasets/{id} | Update dataset |
101 | | -*InformationSchemaApi* | [**information_schema_handler**](docs/InformationSchemaApi.md#information_schema_handler) | **GET** /v1/information_schema | List tables |
102 | | -*QueryApi* | [**query_handler**](docs/QueryApi.md#query_handler) | **POST** /v1/query | Execute SQL query |
103 | | -*QueryRunsApi* | [**list_query_runs_handler**](docs/QueryRunsApi.md#list_query_runs_handler) | **GET** /v1/query-runs | List query runs |
104 | | -*RefreshApi* | [**refresh_handler**](docs/RefreshApi.md#refresh_handler) | **POST** /v1/refresh | Refresh connection data |
105 | | -*ResultsApi* | [**get_result_handler**](docs/ResultsApi.md#get_result_handler) | **GET** /v1/results/{id} | Get result |
106 | | -*ResultsApi* | [**list_results_handler**](docs/ResultsApi.md#list_results_handler) | **GET** /v1/results | List results |
107 | | -*SavedQueriesApi* | [**create_saved_query**](docs/SavedQueriesApi.md#create_saved_query) | **POST** /v1/queries | Create saved query |
108 | | -*SavedQueriesApi* | [**delete_saved_query**](docs/SavedQueriesApi.md#delete_saved_query) | **DELETE** /v1/queries/{id} | Delete saved query |
109 | | -*SavedQueriesApi* | [**execute_saved_query**](docs/SavedQueriesApi.md#execute_saved_query) | **POST** /v1/queries/{id}/execute | Execute saved query |
110 | | -*SavedQueriesApi* | [**get_saved_query**](docs/SavedQueriesApi.md#get_saved_query) | **GET** /v1/queries/{id} | Get saved query |
111 | | -*SavedQueriesApi* | [**list_saved_queries**](docs/SavedQueriesApi.md#list_saved_queries) | **GET** /v1/queries | List saved queries |
112 | | -*SavedQueriesApi* | [**list_saved_query_versions**](docs/SavedQueriesApi.md#list_saved_query_versions) | **GET** /v1/queries/{id}/versions | List saved query versions |
113 | | -*SavedQueriesApi* | [**update_saved_query**](docs/SavedQueriesApi.md#update_saved_query) | **PUT** /v1/queries/{id} | Update saved query |
114 | | -*SecretsApi* | [**create_secret_handler**](docs/SecretsApi.md#create_secret_handler) | **POST** /v1/secrets | Create secret |
115 | | -*SecretsApi* | [**delete_secret_handler**](docs/SecretsApi.md#delete_secret_handler) | **DELETE** /v1/secrets/{name} | Delete secret |
116 | | -*SecretsApi* | [**get_secret_handler**](docs/SecretsApi.md#get_secret_handler) | **GET** /v1/secrets/{name} | Get secret |
117 | | -*SecretsApi* | [**list_secrets_handler**](docs/SecretsApi.md#list_secrets_handler) | **GET** /v1/secrets | List secrets |
118 | | -*SecretsApi* | [**update_secret_handler**](docs/SecretsApi.md#update_secret_handler) | **PUT** /v1/secrets/{name} | Update secret |
119 | | -*UploadsApi* | [**list_uploads**](docs/UploadsApi.md#list_uploads) | **GET** /v1/files | List uploads |
120 | | -*UploadsApi* | [**upload_file**](docs/UploadsApi.md#upload_file) | **POST** /v1/files | Upload file |
121 | | -*WorkspacesApi* | [**create_workspace**](docs/WorkspacesApi.md#create_workspace) | **POST** /v1/workspaces | Create a workspace |
122 | | -*WorkspacesApi* | [**list_workspaces**](docs/WorkspacesApi.md#list_workspaces) | **GET** /v1/workspaces | List workspaces |
123 | | - |
124 | | - |
125 | | -## Documentation For Models |
126 | | - |
127 | | - - [ApiErrorDetail](docs/ApiErrorDetail.md) |
128 | | - - [ApiErrorResponse](docs/ApiErrorResponse.md) |
129 | | - - [CategoryValueInfo](docs/CategoryValueInfo.md) |
130 | | - - [ColumnDefinition](docs/ColumnDefinition.md) |
131 | | - - [ColumnInfo](docs/ColumnInfo.md) |
132 | | - - [ColumnProfileDetail](docs/ColumnProfileDetail.md) |
133 | | - - [ColumnProfileDetailOneOf](docs/ColumnProfileDetailOneOf.md) |
134 | | - - [ColumnProfileDetailOneOf1](docs/ColumnProfileDetailOneOf1.md) |
135 | | - - [ColumnProfileDetailOneOf2](docs/ColumnProfileDetailOneOf2.md) |
136 | | - - [ColumnProfileDetailOneOf3](docs/ColumnProfileDetailOneOf3.md) |
137 | | - - [ColumnProfileDetailOneOf4](docs/ColumnProfileDetailOneOf4.md) |
138 | | - - [ColumnProfileInfo](docs/ColumnProfileInfo.md) |
139 | | - - [ColumnTypeSpec](docs/ColumnTypeSpec.md) |
140 | | - - [ConnectionHealthResponse](docs/ConnectionHealthResponse.md) |
141 | | - - [ConnectionInfo](docs/ConnectionInfo.md) |
142 | | - - [ConnectionRefreshResult](docs/ConnectionRefreshResult.md) |
143 | | - - [ConnectionSchemaError](docs/ConnectionSchemaError.md) |
144 | | - - [CreateConnectionRequest](docs/CreateConnectionRequest.md) |
145 | | - - [CreateConnectionResponse](docs/CreateConnectionResponse.md) |
146 | | - - [CreateDatasetRequest](docs/CreateDatasetRequest.md) |
147 | | - - [CreateDatasetResponse](docs/CreateDatasetResponse.md) |
148 | | - - [CreateSavedQueryRequest](docs/CreateSavedQueryRequest.md) |
149 | | - - [CreateSecretRequest](docs/CreateSecretRequest.md) |
150 | | - - [CreateSecretResponse](docs/CreateSecretResponse.md) |
151 | | - - [CreateWorkspace201Response](docs/CreateWorkspace201Response.md) |
152 | | - - [CreateWorkspaceRequest](docs/CreateWorkspaceRequest.md) |
153 | | - - [DatasetSource](docs/DatasetSource.md) |
154 | | - - [DatasetSourceOneOf](docs/DatasetSourceOneOf.md) |
155 | | - - [DatasetSourceOneOf1](docs/DatasetSourceOneOf1.md) |
156 | | - - [DatasetSummary](docs/DatasetSummary.md) |
157 | | - - [DiscoveryStatus](docs/DiscoveryStatus.md) |
158 | | - - [Error](docs/Error.md) |
159 | | - - [ExecuteSavedQueryRequest](docs/ExecuteSavedQueryRequest.md) |
160 | | - - [GetConnectionResponse](docs/GetConnectionResponse.md) |
161 | | - - [GetDatasetResponse](docs/GetDatasetResponse.md) |
162 | | - - [GetResultResponse](docs/GetResultResponse.md) |
163 | | - - [GetSecretResponse](docs/GetSecretResponse.md) |
164 | | - - [InformationSchemaResponse](docs/InformationSchemaResponse.md) |
165 | | - - [InlineData](docs/InlineData.md) |
166 | | - - [ListConnectionsResponse](docs/ListConnectionsResponse.md) |
167 | | - - [ListDatasetsResponse](docs/ListDatasetsResponse.md) |
168 | | - - [ListQueryRunsResponse](docs/ListQueryRunsResponse.md) |
169 | | - - [ListResultsResponse](docs/ListResultsResponse.md) |
170 | | - - [ListSavedQueriesResponse](docs/ListSavedQueriesResponse.md) |
171 | | - - [ListSavedQueryVersionsResponse](docs/ListSavedQueryVersionsResponse.md) |
172 | | - - [ListSecretsResponse](docs/ListSecretsResponse.md) |
173 | | - - [ListUploadsResponse](docs/ListUploadsResponse.md) |
174 | | - - [ListWorkspaces200Response](docs/ListWorkspaces200Response.md) |
175 | | - - [QueryRequest](docs/QueryRequest.md) |
176 | | - - [QueryResponse](docs/QueryResponse.md) |
177 | | - - [QueryRunInfo](docs/QueryRunInfo.md) |
178 | | - - [RefreshRequest](docs/RefreshRequest.md) |
179 | | - - [RefreshResponse](docs/RefreshResponse.md) |
180 | | - - [RefreshWarning](docs/RefreshWarning.md) |
181 | | - - [ResultInfo](docs/ResultInfo.md) |
182 | | - - [SavedQueryDetail](docs/SavedQueryDetail.md) |
183 | | - - [SavedQuerySummary](docs/SavedQuerySummary.md) |
184 | | - - [SavedQueryVersionInfo](docs/SavedQueryVersionInfo.md) |
185 | | - - [SchemaRefreshResult](docs/SchemaRefreshResult.md) |
186 | | - - [SecretMetadataResponse](docs/SecretMetadataResponse.md) |
187 | | - - [TableInfo](docs/TableInfo.md) |
188 | | - - [TableProfileResponse](docs/TableProfileResponse.md) |
189 | | - - [TableRefreshError](docs/TableRefreshError.md) |
190 | | - - [TableRefreshResult](docs/TableRefreshResult.md) |
191 | | - - [UpdateDatasetRequest](docs/UpdateDatasetRequest.md) |
192 | | - - [UpdateDatasetResponse](docs/UpdateDatasetResponse.md) |
193 | | - - [UpdateSavedQueryRequest](docs/UpdateSavedQueryRequest.md) |
194 | | - - [UpdateSecretRequest](docs/UpdateSecretRequest.md) |
195 | | - - [UpdateSecretResponse](docs/UpdateSecretResponse.md) |
196 | | - - [UploadInfo](docs/UploadInfo.md) |
197 | | - - [UploadResponse](docs/UploadResponse.md) |
198 | | - - [WorkspaceDetail](docs/WorkspaceDetail.md) |
199 | | - - [WorkspaceListItem](docs/WorkspaceListItem.md) |
200 | | - |
201 | | - |
202 | | -<a id="documentation-for-authorization"></a> |
203 | | -## Documentation For Authorization |
204 | | - |
205 | | - |
206 | | -Authentication schemes defined for the API: |
207 | | -<a id="BearerAuth"></a> |
208 | | -### BearerAuth |
209 | | - |
210 | | -- **Type**: Bearer authentication |
211 | | - |
212 | | -<a id="WorkspaceId"></a> |
213 | | -### WorkspaceId |
214 | | - |
215 | | -- **Type**: API key |
216 | | -- **API key parameter name**: X-Workspace-Id |
217 | | -- **Location**: HTTP header |
218 | | - |
219 | | - |
220 | | -## Author |
| 65 | +Each `*Api` class groups endpoints by resource. Construct the client, then call the typed methods you need. |
| 66 | + |
| 67 | +## API reference |
| 68 | + |
| 69 | +Generated Markdown for every operation and model is in [`docs/`](docs/): |
221 | 70 |
|
| 71 | +- Resource APIs: `docs/*Api.md` (for example [`docs/QueryApi.md`](docs/QueryApi.md)) |
| 72 | +- Request and response models: `docs/<ModelName>.md` |
222 | 73 |
|
| 74 | +Use your editor or GitHub file search there instead of duplicating large tables in this file. |
223 | 75 |
|
| 76 | +## Support |
224 | 77 |
|
| 78 | +Questions and issues: [github.com/hotdata-dev/sdk-python](https://github.com/hotdata-dev/sdk-python). |
0 commit comments