SQL programming
Project description
ClickSQL: ClickHouse client for Humans
Package information:
ClickSQL is a smart client for ClickHouse database, which may help users to use ClickHouse more easier and smoother.
more information for ClickHouse can be found at here
Installation
pip install ClickSQL
Usage
initial connection
Approach 1
from ClickSQL import ClickHouseTableNode
conn_str = "clickhouse://default:test121231@99.99.9.9:8123/system"
ct = ClickHouseTableNode(conn_str)
>>> connection test: Ok.
Approach 2
from ClickSQL import ClickHouseTableNode
conn_str = {'name':'clickhouse','host':'99.99.9.9','port':8123,'user':'default',
'password':'test121231','database':'system'}
ct = ClickHouseTableNode(**conn_str)
>>> connection test: Ok.
Query
from ClickSQL import ClickHouseTableNode
conn_str = "clickhouse://default:test121231@99.99.9.9:8123/system"
ct = ClickHouseTableNode(conn_str)
ct.query('show tables from system limit 1')
>>> connection test: Ok.
>>> name
>>> 0 aggregate_function_combinators
update
from ClickSQL import BaseSingleFactorTableNode as factortable
factor = factortable(
'clickhouse://default:default@127.0.0.1:8123/sample.sample',
cols=['cust_no', 'product_id', 'money'],
order_by_cols=['money asc'],
money='money >= 100000'
)
factor >> 'test.test'
from ClickSQL import BaseSingleFactorTableNode
factor = factortable(
'clickhouse://default:default@127.0.0.1:8123/sample.sample',
cols=['cust_no', 'product_id', 'money'],
order_by_cols=['money asc'],
money='money >= 100000'
)
factor['money'].head(10)
>>> connection test: Ok.
>>> money
>>> 0 1000000.0
>>> 1 1000000.0
>>> 2 1000000.0
>>> 3 1000000.0
>>> 4 1000000.0
>>> 5 1000000.0
>>> 6 1000000.0
>>> 7 1000000.0
>>> 8 1000000.0
>>> 9 1000000.0
Contribution
there is welcome to do more work to improve this package more convenient
Author
sn0wfree
functions
- get data from clickhouse
- insert data into clickhouse
- create
- alter
Plan
Available function
- access clickhouse service
- execute standard SQL and transform into dataframe
- able to execute select query
- able to execute insert query
- no require clickhouse-client
- auto create table sql
- can execute explain query
schedule
- create a pandas_liked executable function, which can compatible with pandas
- alter function & drop function
- can execute user role query
- create analysis component
- auto report system
- table register system
- data manager system
- meta data manager
- distributed query(query+insert)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ClickSQL-0.1.7.5.tar.gz
(31.7 kB
view hashes)
Built Distribution
ClickSQL-0.1.7.5-py3-none-any.whl
(39.4 kB
view hashes)
Close
Hashes for ClickSQL-0.1.7.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fd0daa46b0c7e402e1e9d5bbd435ced2b187d0e02075fec23c21ba8fc0bb62f |
|
MD5 | a0a07d0d6844a9237e3553ccfa72c2a4 |
|
BLAKE2b-256 | 3f9b85dd6cba7f69a0f094b08ed9de85f3034280180eb69b2436791adcb76739 |