{"id":25892996,"url":"https://github.com/j3-signalroom/cc-clients-python_lib","last_synced_at":"2026-06-08T17:31:56.724Z","repository":{"id":278975945,"uuid":"937208787","full_name":"j3-signalroom/cc-clients-python_lib","owner":"j3-signalroom","description":"This library provides a collection of Python functions that interact with Confluent Cloud via its RESTful APIs.","archived":false,"fork":false,"pushed_at":"2025-10-04T16:44:09.000Z","size":6246,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T18:22:59.593Z","etag":null,"topics":["confluent-cloud","confluent-flink","confluent-kafka","confluent-metrics","confluent-schema-registry"],"latest_commit_sha":null,"homepage":"https://linkedin.com/in/jeffreyjonathanjennings","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/j3-signalroom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-22T15:42:08.000Z","updated_at":"2025-10-04T16:44:08.000Z","dependencies_parsed_at":"2025-02-28T23:57:24.232Z","dependency_job_id":"87dd1550-9318-4904-b248-fb1fb5a982a1","html_url":"https://github.com/j3-signalroom/cc-clients-python_lib","commit_stats":null,"previous_names":["j3-signalroom/cc-clients-lib","j3-signalroom/cc-clients-python_lib"],"tags_count":53,"template":false,"template_full_name":null,"purl":"pkg:github/j3-signalroom/cc-clients-python_lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j3-signalroom%2Fcc-clients-python_lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j3-signalroom%2Fcc-clients-python_lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j3-signalroom%2Fcc-clients-python_lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j3-signalroom%2Fcc-clients-python_lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j3-signalroom","download_url":"https://codeload.github.com/j3-signalroom/cc-clients-python_lib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j3-signalroom%2Fcc-clients-python_lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34073736,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["confluent-cloud","confluent-flink","confluent-kafka","confluent-metrics","confluent-schema-registry"],"created_at":"2025-03-02T21:29:42.477Z","updated_at":"2026-06-08T17:31:56.719Z","avatar_url":"https://github.com/j3-signalroom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Confluent Cloud Clients Python Library\n\nThe Confluent Cloud Clients Python Library provides a set of clients for interacting with Confluent Cloud REST APIs. The library includes clients for:\n+ **Flink**\n+ **Kafka**\n+ **Schema Registry**\n+ **Tableflow**\n+ **Metrics**\n+ **Environment**\n+ **IAM**\n\n\u003e **Note:** _This library is in active development and is subject to change.  It covers only the methods I have needed so far.  If you need a method that is not covered, please feel free to open an issue or submit a pull request._\n\n**Table of Contents**\n\n\u003c!-- toc --\u003e\n- [**1.0 Library Clients**](#10-library-clients)\n    * [**1.1 Flink Client**](#11-flink-client)\n    * [**1.2 Kafka Topic Client**](#12-kafka-topic-client)\n    * [**1.3 Schema Registry Client**](#13-schema-registry-client)\n    * [**1.4 Tableflow Client**](#14-tableflow-client)\n    * [**1.5 Metrics Client**](#15-metrics-client)\n        + [**1.5.1 Get Topic Totals**](#151-get-topic-totals)\n        + [**1.5.2 Is Topic Partition Hot**](#152-is-topic-partition-hot)\n    * [**1.6 Environment Client**](#16-environment-client)\n    * [**1.7 IAM Client**](#17-iam-client)\n- [**2.0 Unit Tests**](#20-unit-tests)\n    * [**2.1 Flink Client**](#21-flink-client)\n    * [**2.2 Kafka Topic Client**](#22-kafka-topic-client)\n    * [**2.3 Schema Registry Client**](#23-schema-registry-client)\n    * [**2.4 Tableflow Client**](#24-tableflow-client)\n    * [**2.5 Metrics Client**](#25-metrics-client)\n    * [**2.6 Environment Client**](#26-environment-client)\n    * [**2.7 IAM Client**](#27-iam-client)\n- [**3.0 Installation**](#30-installation)\n+ [**4.0 Resources**](#40-resources)\n    * [**4.1 Architecture Design Records (ADRs)**](#41-architecture-design-records-adrs)\n    * [**4.2 API Documentation**](#42-api-documentation)\n    * [**4.3 Flink Resources**](#43-flink-resources)\n    * [**4.4 Tableflow Resources**](#44-tableflow-resources)\n    * [**4.5 Metrics Resources**](#45-metrics-resources)\n    * [**4.6 Other Resources**](#46-other-resources)\n\u003c!-- tocstop --\u003e\n\n## **1.0 Library Clients**\n\n### **1.1 Flink Client**\nThe **Flink Client** provides the following methods:\n- `delete_statement`\n- `delete_statements_by_phase`\n- `drop_table`\n    \u003e _**Note:**  \"The `drop_table` method will drop the table and all associated statements, including the backing Kafka Topic and Schemas.\"_\n- `get_compute_pool`\n- `get_compute_pool_list`\n- `get_statement_list`\n- `stop_statement`\n    \u003e _**Note:**  \"Confluent Cloud for Apache Flink enforces a **30-day** retention for statements in terminal states.\"_\n- `submit_statement`\n- `update_statement`\n- `update_all_sink_statements`\n\n### **1.2 Kafka Topic Client**\nThe **Kafka Topic Client** provides the following methods:\n- `delete_kafka_topic`\n- `kafka_topic_exist`\n- `kafka_get_topic`\n\n### **1.3 Schema Registry Client**\nThe **Schema Registry Client** provides the following methods:\n- `convert_avro_schema_into_string`\n- `delete_kafka_topic_key_schema_subject`\n- `delete_kafka_topic_value_schema_subject`\n- `get_global_topic_subject_compatibility_level`\n- `get_topic_subject_compatibility_level`\n- `get_topic_subject_latest_schema`\n- `register_topic_subject_schema`\n- `set_topic_subject_compatibility_level`\n- `get_schema_registry_cluster_list`\n\n### **1.4 Tableflow Client**\nThe **Tableflow Client** provides the following methods:\n- `get_tableflow_topic`\n- `get_tableflow_topic_table_path`\n\n### **1.5 Metrics Client**\n\n#### **1.5.1 Get Topic Totals**\nThe **Metrics Client** provides the following methods:\n- `get_topic_total`    \n- `get_topic_daily_aggregated_totals`\n\nMetric Type|Description\n-|-\n`RECEIVED_BYTES`|The delta count of bytes of the customer's data received from the network. Each sample is the number of bytes received since the previous data sample. The count is sampled every 60 seconds.\n`RECEIVED_RECORDS`|The delta count of records of the customer's data received from the network. Each sample is the number of records received since the previous data sample. The count is sampled every 60 seconds.\n`SENT_BYTES`|The delta count of bytes of the customer's data sent to the network. Each sample is the number of bytes sent since the previous data sample. The count is sampled every 60 seconds.\n`SENT_RECORDS`|The delta count of records of the customer's data sent to the network. Each sample is the number of records sent since the previous data sample. The count is sampled every 60 seconds.\n\n#### **1.5.2 Is Topic Partition Hot**\nThe **Metrics Client** provides the following methods:\n- `is_topic_partition_hot`\n\nMetric Type|Description\n-|-\n`INGRESS`|An indicator of the presence of a hot partition caused by ingress throughput. The value is 1.0 when a hot partition is detected, and empty when there is no hot partition detected\n`EGRESS`|An indicator of the presence of a hot partition caused by egress throughput. The value is 1.0 when a hot partition is detected, and empty when there is no hot partition detected\n\n### **1.6 Environment Client**\nThe **Environment Client** provides the following methods:\n- `get_environment_list`\n- `get_kafka_cluster_list`\n\n### **1.7 IAM Client**\nThe **IAM Client** provides the following methods:\n- `get_all_api_keys_by_principal_id`\n- `create_api_key`\n- `delete_api_key`\n\n## **2.0 Unit Tests**\nThe library includes unit tests for each client. The tests are located in the `tests` directory.  To use them, you must clone the repo locally:\n\n```shell\ngit clone https://github.com/j3-signalroom/cc-clients-python_lib.git\n```\n\n Since this project was built using [**`uv`**](https://docs.astral.sh/uv/), please install it, and then run the following command to install all the project dependencies:\n\n```shell\n uv sync\n ```\n\nThen within the `tests` directory, create the `.env` file and add the following environment variables, filling them with your Confluent Cloud credentials and other required values:\n\n```properties\nBOOTSTRAP_SERVER_CLOUD_PROVIDER=\nBOOTSTRAP_SERVER_CLOUD_REGION=\nBOOTSTRAP_SERVER_ID=\nCLOUD_PROVIDER=\nCLOUD_REGION=\nCOMPUTE_POOL_ID=\nCONFLUENT_CLOUD_API_KEY=\nCONFLUENT_CLOUD_API_SECRET=\nENVIRONMENT_ID=\nFLINK_API_KEY=\nFLINK_API_SECRET=\nFLINK_CATALOG_NAME=\nFLINK_DATABASE_NAME=\nFLINK_STATEMENT_NAME=\nFLINK_TABLE_NAME=\nFLINK_URL=\nKAFKA_API_KEY=\nKAFKA_API_SECRET=\nKAFKA_CLUSTER_ID=\nKAFKA_TOPIC_NAME=\nORGANIZATION_ID=\nPRINCIPAL_ID=\nQUERY_START_TIME=\nQUERY_END_TIME=\nSCHEMA_REGISTRY_API_KEY=\nSCHEMA_REGISTRY_API_SECRET=\nSCHEMA_REGISTRY_URL=\nTABLEFLOW_API_KEY=\nTABLEFLOW_API_SECRET=\n```\n\n\u003e **Note:** _The `QUERY_START_TIME` and `QUERY_END_TIME` environment variables should be in the format `YYYY-MM-DDTHH:MM:SS`, for example, `2025-09-01T00:00:00`._\n\n### **2.1 Flink Client**\nTo run a specific test, use one of the following commands:\n\nUnit Test|Command\n-|-\nDelete a Flink Statement|`uv run pytest -s tests/test_flink_client.py::test_delete_statement`\nDelete all Flink Statements by Phase|`uv run pytest -s tests/test_flink_client.py::test_delete_statements_by_phase`\nGet list of the all the Statements|`uv run pytest -s tests/test_flink_client.py::test_get_statement_list`\nSubmit a Flink Statement|`uv run pytest -s tests/test_flink_client.py::test_submit_statement`\nGet Compute Pool List|`uv run pytest -s tests/test_flink_client.py::test_get_compute_pool_list`\nGet Compute Pool|`uv run pytest -s tests/test_flink_client.py::test_get_compute_pool`\nStop a Flink Statement|`uv run pytest -s tests/test_flink_client.py::test_stop_statement`\nUpdate a Flink Statement|`uv run pytest -s tests/test_flink_client.py::test_update_statement`\nUpdate all the Sink Statements|`uv run pytest -s tests/test_flink_client.py::test_update_all_sink_statements`\nDrop a Flink Table along with any associated statements, including the backing Kafka Topic and Schemas|`uv run pytest -s tests/test_flink_client.py::test_drop_table`\n\nOtherwise, to run all the tests, use the following command:\n```shell\nuv run pytest -s tests/test_flink_client.py\n```\n\n\u003e **Note:** _The tests are designed to be run in a specific order.  If you run them out of order, you may encounter errors.  The tests are also designed to be run against a Confluent Cloud environment.  If you run them against a local environment, you may encounter errors._\n\n### **2.2 Kafka Topic Client**\nTo run a specific test, use one of the following commands:\n\nUnit Test|Command\n-|-\nDelete a Kafka Topic|`uv run pytest -s tests/test_kafka_topic_client.py::test_delete_kafka_topic`\nChecks if a Kafka Topic Exist|`uv run pytest -s tests/test_kafka_topic_client.py::test_kafka_topic_exist`\nGet Kafka Topic Details|`uv run pytest -s tests/test_kafka_topic_client.py::test_kafka_get_topic`\n\nOtherwise, to run all the tests, use the following command:\n```shell\nuv run pytest -s tests/test_kafka_topic_client.py\n```\n\n\u003e **Note:** _The tests are designed to be run in a specific order.  If you run them out of order, you may encounter errors.  The tests are also designed to be run against a Confluent Cloud environment.  If you run them against a local environment, you may encounter errors._\n\n### **2.3 Schema Registry Client**\nTo run a specific test, use one of the following commands:\n\nUnit Test|Command\n-|-\nGet the Subject Compatibility Level|`uv run pytest -s tests/test_schema_registry_client.py::TestSchemaRegistryClient::test_get_subject_compatibility_level`\nDelete the Kafka Topic Key Schema Subject|`uv run pytest -s tests/test_schema_registry_client.py::TestSchemaRegistryClient::test_delete_kafka_topic_key_schema_subject`\nDelete the Kafka Topic Value Schema Subject|`uv run pytest -s tests/test_schema_registry_client.py::TestSchemaRegistryClient::test_delete_kafka_topic_value_schema_subject`\nGet list of all the Schema Registry Clusters|`uv run pytest -s tests/test_schema_registry_client.py::TestSchemaRegistryClient::test_getting_all_schema_registry_clusters`\n\nOtherwise, to run entire test suite, use the following command:\n```shell\nuv run pytest -s tests/test_schema_registry_client.py\n```\n\n\u003e **Note:** _The tests are designed to be run in a specific order.  If you run them out of order, you may encounter errors.  The tests are also designed to be run against a Confluent Cloud environment.  If you run them against a local environment, you may encounter errors._\n\n### **2.4 Tableflow Client**\nTo run a specific test, use one of the following commands:\n\nUnit Test|Command\n-|-\nGet the Tableflow Topic|`uv run pytest -s tests/test_tableflow_client.py::test_get_tableflow_topic`\nGet the Tableflow Topic Table Path|`uv run pytest -s tests/test_tableflow_client.py::test_get_tableflow_topic_table_path`\n\nOtherwise, to run all the tests, use the following command:\n```shell\nuv run pytest -s tests/test_tableflow_client.py\n```\n\n\u003e **Note:** _The tests are designed to be run in a specific order.  If you run them out of order, you may encounter errors.  The tests are also designed to be run against a Confluent Cloud environment.  If you run them against a local environment, you may encounter errors._\n\n### **2.5 Metrics Client**\nTo run a specific test, use one of the following commands:\n\nUnit Test|Command\n-|-\nGet the Topic Received Total Bytes|`uv run pytest -s tests/test_metrics_client.py::test_get_topic_received_total_bytes`\nGet the Topic Received Total Records|`uv run pytest -s tests/test_metrics_client.py::test_get_topic_received_total_records`\nGet the Topic Received Daily Aggregated Totals Bytes|`uv run pytest -s tests/test_metrics_client.py::test_get_topic_received_daily_aggregated_totals_bytes`\nGet the Topic Received Daily Aggregated Totals Records|`uv run pytest -s tests/test_metrics_client.py::test_get_topic_received_daily_aggregated_totals_records`\nCompute the Topic Partition Count Based on Received Bytes and Record Count|`uv run pytest -s tests/test_metrics_client.py::test_compute_topic_partition_count_based_on_received_bytes_record_count`\nGet the Topic Sent Total Bytes|`uv run pytest -s tests/test_metrics_client.py::test_get_topic_sent_total_bytes`\nGet the Topic Sent Total Records|`uv run pytest -s tests/test_metrics_client.py::test_get_topic_sent_total_records`\nGet the Topic Sent Daily Aggregated Totals Bytes|`uv run pytest -s tests/test_metrics_client.py::test_get_topic_sent_daily_aggregated_totals_bytes`\nGet the Topic Sent Daily Aggregated Totals Records|`uv run pytest -s tests/test_metrics_client.py::test_get_topic_sent_daily_aggregated_totals_records`\nCompute the Topic Partition Count Based on Sent Bytes and Record Count|`uv run pytest -s tests/test_metrics_client.py::test_compute_topic_partition_count_based_on_sent_bytes_record_count`\nCheck if a Topic Partition is Hot Based on Ingress|`uv run pytest -s tests/test_metrics_client.py::test_is_topic_partition_hot_by_ingress_throughput`\nCheck if a Topic Partition is Hot Based on Egress|`uv run pytest -s tests/test_metrics_client.py::test_is_topic_partition_hot_by_egress_throughput`\n\nOtherwise, to run all the tests, use the following command:\n```shell\nuv run pytest -s tests/test_metrics_client.py\n```\n\n\u003e **Note:** _The tests are designed to be run in a specific order.  If you run them out of order, you may encounter errors.  The tests are also designed to be run against a Confluent Cloud environment.  If you run them against a local environment, you may encounter errors._\n\n### **2.6 Environment Client**\nTo run a specific test, use one of the following commands:\n\nUnit Test|Command\n-|-\nGet list of all the Environments|`uv run pytest -s tests/test_environment_client.py::test_get_environments`\nGet list of the all the Kafka clusters|`uv run pytest -s tests/test_environment_client.py::test_get_kafka_clusters`\n\nOtherwise, to run all the tests, use the following command:\n```shell\nuv run pytest -s tests/test_environment_client.py\n```\n\n\u003e **Note:** _The tests are designed to be run in a specific order.  If you run them out of order, you may encounter errors.  The tests are also designed to be run against a Confluent Cloud environment.  If you run them against a local environment, you may encounter errors._\n\n### **2.7 IAM Client**\nTo run a specific test, use one of the following commands:\nUnit Test|Command\n-|-\nGet all API Keys by Principal ID|`uv run pytest -s tests/test_iam_client.py::TestIamClient::test_get_all_api_keys_by_principal_id`\nDelete all API Keys by Principal ID|`uv run pytest -s tests/test_iam_client.py::TestIamClient::test_delete_all_api_keys_by_principal_id`\nCreate and Delete an API Key|`uv run pytest -s tests/test_iam_client.py::TestIamClient::test_create_and_delete_api_key`\nIterate through Environments Creating and Deleting API Keys|`uv run pytest -s tests/test_iam_client.py::TestIamClient::test_creating_and_deleting_kafka_api_keys`\n\nOtherwise, to run entire test suite, use the following command:\n```shell\nuv run pytest -s tests/test_iam_client.py\n```\n\n## **3.0 Installation**\nInstall the Confluent Cloud Clients Python Library using **`pip`**:\n```shell\npip install cc-clients-python-lib\n```\n\nOr, using [**`uv`**](https://docs.astral.sh/uv/):\n```shell\nuv add cc-clients-python-lib\n```\n\n## **4.0 Resources**\n\n### **4.1 Architecture Design Records (ADRs)**\n* [001 Architectural Design Record (ADR):  Drop Table Plus](https://github.com/j3-signalroom/cc-clients-python_lib/blob/main/.blog/adr_001.md)\n\n### **4.2 API Documentation**\n* [Flink SQL REST API for Confluent Cloud for Apache Flink](https://docs.confluent.io/cloud/current/flink/operate-and-deploy/flink-rest-api.html)\n* [Kafka REST APIs for Confluent Cloud](https://docs.confluent.io/cloud/current/kafka-rest/kafka-rest-cc.html)\n* [Confluent Cloud APIs - Topic (v3)](https://docs.confluent.io/cloud/current/api.html#tag/Topic-(v3))\n* [Confluent Cloud Schema Registry REST API Usage](https://docs.confluent.io/cloud/current/sr/sr-rest-apis.html)\n\n### **4.3 Flink Resources**\n* [CCAF State management](https://docs.confluent.io/cloud/current/flink/concepts/overview.html#state-management)\n* [Monitor and Manage Flink SQL Statements in Confluent Cloud for Apache Flink](https://docs.confluent.io/cloud/current/flink/operate-and-deploy/monitor-statements.html#)\n* [DROP TABLE Statement in Confluent Cloud for Apache Flink](https://docs.confluent.io/cloud/current/flink/reference/statements/drop-table.html#drop-table-statement-in-af-long)\n\n### **4.4 Tableflow Resources**\n* [Tableflow Topics (tableflow/v1)](https://docs.confluent.io/cloud/current/api.html#tag/Tableflow-Topics-(tableflowv1))\n\n### **4.4 Tableflow Resources**\n* [Tableflow Topics (tableflow/v1)](https://docs.confluent.io/cloud/current/api.html#tag/Tableflow-Topics-(tableflowv1))\n\n### **4.5 Metrics Resources**\n* [Confluent Cloud Metrics API Version 2 Reference](https://api.telemetry.confluent.cloud/docs#tag/Version-2)\n* [Confluent Cloud Metrics API: Metrics Reference](https://api.telemetry.confluent.cloud/docs/descriptors/datasets/cloud)\n* [Confluent Cloud Metrics](https://docs.confluent.io/cloud/current/monitoring/metrics-api.html#ccloud-metrics)\n\n### **4.6 Other Resources**\n* [How to programmatically pause and resume a Flink statement](.blog/how-to-programmatically-pause-and-resume-a-flink-statement.md)\n* [How to programmatically pause and resume a Flink statement REDUX](.blog/how-to-programmatically-pause-and-resume-a-flink-statement-redux.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj3-signalroom%2Fcc-clients-python_lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj3-signalroom%2Fcc-clients-python_lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj3-signalroom%2Fcc-clients-python_lib/lists"}