Skip to main content
https://img.shields.io/pypi/v/kylinpy.svg https://img.shields.io/github/license/kyligence/kylinpy.svg https://img.shields.io/pypi/pyversions/kylinpy.svg https://img.shields.io/pypi/dm/kylinpy.svg https://codecov.io/gh/zhaoyongjie/kylinpy/branch/master/graph/badge.svg

Apache Kylin Python Client Library

Apache Kylin Python Client Library is a python-based Apache Kylin client.

Any application that uses SQLAlchemy can now query Apache Kylin with this Apache Kylin dialect installed.

Installation

The easiest way to install Apache Kylin Python Client Library is to use pip:

pip install kylinpy

alternative, install by offline tarball package:

# download from https://pypi.org/project/kylinpy/#files
pip install kylinpy-<version>.tar.gz

Apache Kylin dialect for SQLAlchemy

Any application that uses SQLAlchemy can now query Apache Kylin with this Apache Kylin dialect installed.

You may use below template to build DSN to connect Apache Kylin:

kylin://<username>:<password>@<hostname>:<port>/<project>?<param1>=<value1>&<param2>=<value2>

DSN Fields

Default

Allow omitted

username

null

false

password

null

false

hostname

null

false

port

7070

true

project

null

false

DSN query string config is as follows

Fields

Default Value

Optional value

Description

is_ssl

0

0|1

Is the Kylin cluster enabled for https

prefix

/kylin/api

string

Kylin cluster API prefix

timeout

30

integer > 0

HTTP timeout with Kylin cluster

version

v1

v1|v2|v4

v1 == using Apache Kylin API

v2 == using Kyligence Enterprise 3 API

v4 == using Kyligence Enterprise 4 API

is_pushdown

0

0|1

If enabled, viewing a project table will use the hive source table

is_debug

0

0|1

Whether to enable debug mode

From SQLAlchemy access Apache Kylin

$ python
>>> import sqlalchemy as sa
>>> kylin_engine = sa.create_engine('kylin://ADMIN:KYLIN@sandbox/learn_kylin?timeout=60&is_debug=1')
>>> results = kylin_engine.execute('SELECT count(*) FROM KYLIN_SALES')
>>> [e for e in results]
[(4953,)]
>>> kylin_engine.table_names()
[u'KYLIN_ACCOUNT',
 u'KYLIN_CAL_DT',
 u'KYLIN_CATEGORY_GROUPINGS',
 u'KYLIN_COUNTRY',
 u'KYLIN_SALES',
 u'KYLIN_STREAMING_TABLE']

From Pandas access Apache Kylin

$ python
 >>> import sqlalchemy as sa
 >>> import pandas as pd
 >>> kylin_engine = sa.create_engine('kylin://ADMIN:KYLIN@sandbox/learn_kylin?timeout=60&is_debug=1')
 >>> sql = 'select * from kylin_sales limit 10'
 >>> pd.read_sql(sql, kylin_engine)

From Superset access Apache Kylin

Now you can configure the DSN in your application to establish the connection with Apache Kylin.

For example, you may install Apache Kylin Python Client Library in your Superset environment and configure connection to Apache Kylin in Superset

https://raw.githubusercontent.com/Kyligence/kylinpy/master/docs/picture/superset1.png

then you may be able to query Apache Kylin one table at a time from Superset

https://raw.githubusercontent.com/Kyligence/kylinpy/master/docs/picture/superset2.png

you may also be able to query detail data

https://raw.githubusercontent.com/Kyligence/kylinpy/master/docs/picture/superset3.png

Alternatively, you may also be able to query multiple tables from Apache Kylin by using SQL Lab in Superset.

https://raw.githubusercontent.com/Kyligence/kylinpy/master/docs/picture/superset4.png

Release files for kylinpy 2.8.4

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

Source distribution (sdist)

Source distribution for kylinpy 2.8.4
File Size Uploaded
kylinpy-2.8.4.tar.gz 30.1 kB Details

Release files / kylinpy-2.8.4.tar.gz

Download URL kylinpy-2.8.4.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4106acac0fc83abcd8dea3c1d9ea3c9ade108ace068de6a2bd2e0d7571b26643
BLAKE2b-256 checksum
How to use checksums
f2b71828ab71898e671323cd76e8960cf1f5ea463a95c6fd63815a4d533cf1f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

Release history Release notifications | RSS feed

This release

2.8.4 This release

1 release file

2.8.3

1 release file

2.8.2

1 release file

2.8.1

1 release file

2.8.0

1 release file

2.7.0

1 release file

2.6.0

1 release file

2.5.0

1 release file

2.4.1

1 release file

2.4.0

1 release file

2.3.1

1 release file

2.3.0

2 release files

2.2.1

1 release file

2.2.0

1 release file

2.1.2

1 release file

2.1.1

1 release file

2.1.0

1 release file

2.0.2

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.6.3

1 release file

1.6.2

1 release file

1.6.1

1 release file

1.6.0

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.4

1 release file

1.4.3

1 release file

1.4.2

1 release file

1.4.0

1 release file

1.3.0

1 release file

1.2.0

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.13

1 release file

1.0.12

1 release file

1.0.11

1 release file

1.0.10

1 release file

1.0.9

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

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