myscaledb-client


Namemyscaledb-client JSON
Version 2.0.6 PyPI version JSON
download
home_pagehttps://github.com/myscale/myscaledb-client
SummaryAsync and sync http MyScale client for python 3.6+
upload_time2023-03-27 03:57:09
maintainer
docs_urlNone
authorMochiXu
requires_python
licenseMIT
keywords clickhouse async sync python aiohttp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # MyScale Database Client

[![PyPI version](https://badge.fury.io/py/myscaledb-client.svg)](https://badge.fury.io/py/myscaledb-client)
[![Documentation Status](https://readthedocs.org/projects/myscaledb-client/badge/?version=latest)](https://myscaledb-client.readthedocs.io/en/latest/?badge=latest)

`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

- [MyScale Database Client](#myscale-database-client)
  - [Table of Contents](#table-of-contents)
  - [Installation](#installation)
  - [Quick Start](#quick-start)
    - [Connecting to MyScale](#connecting-to-myscale)
    - [Querying the database](#querying-the-database)
  - [Documentation](#documentation)

## Installation

We recommend you to install it with command:

```bash
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.

```python
# 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:

```python
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:

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

## Documentation

To check out the [API docs](https://myscaledb-client.readthedocs.io/en/latest/introduction.html), visit the [readthedocs site](https://myscaledb-client.readthedocs.io/en/latest/introduction.html).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/myscale/myscaledb-client",
    "name": "myscaledb-client",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "clickhouse async sync python aiohttp",
    "author": "MochiXu",
    "author_email": "mochix@moqi.ai",
    "download_url": "https://files.pythonhosted.org/packages/48/ca/69607c44e0789d1c512d374ecf1c914c2ac48a47e1aafa789b0aee0615c4/myscaledb-client-2.0.6.tar.gz",
    "platform": null,
    "description": "# MyScale Database Client\n\n[![PyPI version](https://badge.fury.io/py/myscaledb-client.svg)](https://badge.fury.io/py/myscaledb-client)\n[![Documentation Status](https://readthedocs.org/projects/myscaledb-client/badge/?version=latest)](https://myscaledb-client.readthedocs.io/en/latest/?badge=latest)\n\n`myscaledb-client` is an async/sync http(s) MyScale client for python 3.6+ supporting\ntype conversion in both directions, streaming, lazy decoding on select queries,\nand a fully typed interface.\n\n## Table of Contents\n\n- [MyScale Database Client](#myscale-database-client)\n  - [Table of Contents](#table-of-contents)\n  - [Installation](#installation)\n  - [Quick Start](#quick-start)\n    - [Connecting to MyScale](#connecting-to-myscale)\n    - [Querying the database](#querying-the-database)\n  - [Documentation](#documentation)\n\n## Installation\n\nWe recommend you to install it with command:\n\n```bash\npip install myscaledb-client\n```\n\n## Quick Start\n\n### Connecting to MyScale\n\nThe quickest way to get up and running with `myscaledb-client` is to simply connect\nand check MyScale is alive.\n\n```python\n# This is a demo using Client.\n# Client works in sync mode and is simple to use.\n\nfrom myscaledb import Client\n\ndef main():\n    client = Client(url='http://localhost:8123')\n    alive = client.is_alive()\n    print(f\"Is MyScale alive? -> {alive}\")\n\nif __name__ == '__main__':\n    main()\n```\n\n### Querying the database\n\nCreate a table with 4 dimensional vectors:\n\n```python\nclient.execute(\n    \"\"\"CREATE TABLE default.test\n    (\n        id UInt64,\n        name String,\n        vector FixedArray(Float32, 4)\n    )\n    ENGINE = MergeTree ORDER BY id\"\"\"\n)\n```\n\nView all tables in current database:\n\n```python\nres = client.fetch(query=\"show tables\")\nprint([row[0] for row in res])\n```\n\n## Documentation\n\nTo check out the [API docs](https://myscaledb-client.readthedocs.io/en/latest/introduction.html), visit the [readthedocs site](https://myscaledb-client.readthedocs.io/en/latest/introduction.html).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Async and sync http MyScale client for python 3.6+",
    "version": "2.0.6",
    "split_keywords": [
        "clickhouse",
        "async",
        "sync",
        "python",
        "aiohttp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8a056d4e84f3c286adf726357288b1ae1887c574f2a60cdaefdc02be4cf4de9",
                "md5": "0deb6021ceb3a16adaa2e515f7adfafc",
                "sha256": "3d61277a8ba4dea0628c72b38668bb5968e9b71d6e7dc00443bf1ede5d1f2131"
            },
            "downloads": -1,
            "filename": "myscaledb_client-2.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0deb6021ceb3a16adaa2e515f7adfafc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 31365,
            "upload_time": "2023-03-27T03:57:07",
            "upload_time_iso_8601": "2023-03-27T03:57:07.935441Z",
            "url": "https://files.pythonhosted.org/packages/e8/a0/56d4e84f3c286adf726357288b1ae1887c574f2a60cdaefdc02be4cf4de9/myscaledb_client-2.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48ca69607c44e0789d1c512d374ecf1c914c2ac48a47e1aafa789b0aee0615c4",
                "md5": "43db641f5cdbcbf716f76d4350974124",
                "sha256": "ad6e06850aaf6660194e1961381efe30416a524f7ab592551a18864439429cc1"
            },
            "downloads": -1,
            "filename": "myscaledb-client-2.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "43db641f5cdbcbf716f76d4350974124",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 32639,
            "upload_time": "2023-03-27T03:57:09",
            "upload_time_iso_8601": "2023-03-27T03:57:09.626848Z",
            "url": "https://files.pythonhosted.org/packages/48/ca/69607c44e0789d1c512d374ecf1c914c2ac48a47e1aafa789b0aee0615c4/myscaledb-client-2.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-27 03:57:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "myscale",
    "github_project": "myscaledb-client",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "myscaledb-client"
}
        
Elapsed time: 0.98836s