The `kylinpy` library provides a Python client to interact with Apache Kylin, an OLAP engine for Big Data, allowing users to query and manage Kylin instances programmatically. It abstracts the REST API interactions, facilitating tasks such as executing queries, managing projects, and retrieving metadata. The current version is 2.8.4, and it maintains an active release cadence, often aligning with Apache Kylin server updates.
pip install kylinpyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to connect to an Apache Kylin instance, select a project, and execute a simple SQL query using the `kylinpy` client. It retrieves the results directly into a pandas DataFrame. Credentials and project name are sourced from environment variables for secure and flexible configuration.
Always call `client.use_project()` with a valid project name before performing project-specific operations like querying or metadata retrieval.
Choose the appropriate query result method (`query_to_dataframe`, `query_to_list`, or lower-level API calls) based on your specific use case, performance requirements, and whether you intend to work with pandas DataFrames.
For asynchronous operations, explicitly use `KylinAsyncClient` and adhere to `async`/`await` patterns. For synchronous applications, `KylinClient` remains the correct choice.