Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
.. image:: https://img.shields.io/pypi/v/clickhouse-driver.svg :target: https://pypi.org/project/clickhouse-driver
.. image:: https://coveralls.io/repos/github/mymarilyn/clickhouse-driver/badge.svg?branch=master :target: https://coveralls.io/github/mymarilyn/clickhouse-driver?branch=master
.. image:: https://img.shields.io/pypi/l/clickhouse-driver.svg :target: https://pypi.org/project/clickhouse-driver
.. image:: https://img.shields.io/pypi/pyversions/clickhouse-driver.svg :target: https://pypi.org/project/clickhouse-driver
.. image:: https://img.shields.io/pypi/dm/clickhouse-driver.svg :target: https://pypi.org/project/clickhouse-driver
.. image:: https://github.com/mymarilyn/clickhouse-driver/actions/workflows/actions.yml/badge.svg :target: https://github.com/mymarilyn/clickhouse-driver/actions/workflows/actions.yml
ClickHouse Python Driver with native (TCP) interface support.
Asynchronous wrapper is available here: https://github.com/mymarilyn/aioch
External data for query processing.
Query settings.
Compression support.
TLS support.
Types support:
Query progress information.
Block by block results streaming.
Reading query profile info.
Receiving server logs.
Multiple hosts support.
Python DB API 2.0 specification support.
Optional NumPy arrays support.
Documentation is available at https://clickhouse-driver.readthedocs.io.
There are two ways to communicate with server:
Pure Client example:
.. code-block:: python
>>> from clickhouse_driver import Client
>>>
>>> client = Client('localhost')
>>>
>>> client.execute('SHOW TABLES')
[('test',)]
>>> client.execute('DROP TABLE IF EXISTS test')
[]
>>> client.execute('CREATE TABLE test (x Int32) ENGINE = Memory')
[]
>>> client.execute(
... 'INSERT INTO test (x) VALUES',
... [{'x': 100}]
... )
1
>>> client.execute('INSERT INTO test (x) VALUES', [[200]])
1
>>> client.execute(
... 'INSERT INTO test (x) '
... 'SELECT * FROM system.numbers LIMIT %(limit)s',
... {'limit': 3}
... )
[]
>>> client.execute('SELECT sum(x) FROM test')
[(303,)]
DB API example:
.. code-block:: python
>>> from clickhouse_driver import connect
>>>
>>> conn = connect('clickhouse://localhost')
>>> cursor = conn.cursor()
>>>
>>> cursor.execute('SHOW TABLES')
>>> cursor.fetchall()
[('test',)]
>>> cursor.execute('DROP TABLE IF EXISTS test')
>>> cursor.fetchall()
[]
>>> cursor.execute('CREATE TABLE test (x Int32) ENGINE = Memory')
>>> cursor.fetchall()
[]
>>> cursor.executemany(
... 'INSERT INTO test (x) VALUES',
... [{'x': 100}]
... )
>>> cursor.rowcount
1
>>> cursor.executemany('INSERT INTO test (x) VALUES', [[200]])
>>> cursor.rowcount
1
>>> cursor.execute(
... 'INSERT INTO test (x) '
... 'SELECT * FROM system.numbers LIMIT %(limit)s',
... {'limit': 3}
... )
>>> cursor.rowcount
0
>>> cursor.execute('SELECT sum(x) FROM test')
>>> cursor.fetchall()
[(303,)]
ClickHouse Python Driver is distributed under the MIT license <http://www.opensource.org/licenses/mit-license.php>
_.
FAQs
Python driver with native interface for ClickHouse
We found that clickhouse-driver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.