Skip to main content

Async and sync http MyScale client for python 3.6+

Project description

MyScale Database Client

PyPI version Documentation Status

myscaledb-client is an async/sync http(s) MyScale client for python 3.6+ supporting type conversion in both directions, streaming, lazy decoding on select queries, and a fully typed interface.

Table of Contents

Installation

We recommend you to install it with command:

pip install myscaledb-client

Quick Start

Connecting to MyScale

The quickest way to get up and running with myscaledb-client is to simply connect and check MyScale is alive.

# This is a demo using Client.
# Client works in sync mode and is simple to use.

from myscaledb import Client

def main():
    client = Client(url='http://localhost:8123')
    alive = client.is_alive()
    print(f"Is MyScale alive? -> {alive}")

if __name__ == '__main__':
    main()

Querying the database

Create a table with 4 dimensional vectors:

client.execute(
    """CREATE TABLE default.test
    (
        id UInt64,
        name String,
        vector FixedArray(Float32, 4)
    )
    ENGINE = MergeTree ORDER BY id"""
)

View all tables in current database:

res = client.fetch(query="show tables")
print([row[0] for row in res])

Documentation

To check out the API docs, visit the readthedocs site.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

myscaledb-client-2.0.6.tar.gz (32.6 kB view hashes)

Uploaded Source

Built Distribution

myscaledb_client-2.0.6-py3-none-any.whl (31.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page