{"id":24685009,"url":"https://github.com/surister/cratedb-async","last_synced_at":"2025-09-02T04:09:48.715Z","repository":{"id":273227329,"uuid":"918128447","full_name":"surister/cratedb-async","owner":"surister","description":"asynchronous http driver for CrateDB","archived":false,"fork":false,"pushed_at":"2025-08-17T11:08:10.000Z","size":173,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-17T13:08:09.487Z","etag":null,"topics":["async","connector","cratedb","database","driver","http","httpx","sql","trio"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/surister.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-17T09:59:04.000Z","updated_at":"2025-08-17T11:08:07.000Z","dependencies_parsed_at":"2025-04-04T15:29:04.047Z","dependency_job_id":"45953816-68c3-4c6e-bac9-ce00b3c5480c","html_url":"https://github.com/surister/cratedb-async","commit_stats":null,"previous_names":["surister/cratedb-async"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/surister/cratedb-async","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surister%2Fcratedb-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surister%2Fcratedb-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surister%2Fcratedb-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surister%2Fcratedb-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/surister","download_url":"https://codeload.github.com/surister/cratedb-async/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surister%2Fcratedb-async/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273228168,"owners_count":25067738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","connector","cratedb","database","driver","http","httpx","sql","trio"],"created_at":"2025-01-26T15:17:22.834Z","updated_at":"2025-09-02T04:09:48.710Z","avatar_url":"https://github.com/surister.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CrateDB Async driver based on httpx.\n![PyPI - Version](https://img.shields.io/pypi/v/cratedb-async)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cratedb-async)\n![PyPI - License](https://img.shields.io/pypi/l/cratedb-async)\n![PyPI - Status](https://img.shields.io/pypi/status/cratedb-async)\n[![Upload](https://github.com/surister/cratedb-async/actions/workflows/python-publish.yml/badge.svg)](https://github.com/surister/cratedb-async/actions/workflows/python-publish.yml)\n\nAsynchronous driver for CrateDB, it uses the HTTP protocol and follows its own design.\n\n## Usage\n\nIt can be used with any async library:\n\n#### Asyncio\n```python\n\nimport asyncio\n\nfrom cratedb_async.client import CrateClient\n\n\nasync def main():\n    crate = CrateClient('http://192.168.88.251:4200')\n    response = await crate.query('SELECT * FROM sys.summits')\n    print(response.as_table())\n\nasyncio.run(main())\n\n# +----------------+---------------------+---------+--------------+--------+----------------+------------+---------------+----------------------+\n# | classification | coordinates         | country | first_ascent | height | mountain       | prominence | range         | region               |\n# +----------------+---------------------+---------+--------------+--------+----------------+------------+---------------+----------------------+\n# | I/B-07.V-B     | [6.86444, 45.8325]  | FR/IT   | 1786         | 4808   | Mont Blanc     | 4695       | U-Savoy/Aosta | Mont Blanc massif    |\n# | I/B-09.III-A   | [7.86694, 45.93694] | CH      | 1855         | 4634   | Monte Rosa     | 2165       | Valais        | Monte Rosa Alps      |\n# | I/B-09.V-A     | [7.85889, 46.09389] | CH      | 1858         | 4545   | Dom            | 1046       | Valais        | Mischabel            |\n# | I/B-09.III-A   | [7.83556, 45.92222] | CH/IT   | 1861         | 4527   | Liskamm        | 376        | Valais/Aosta  | Monte Rosa Alps      |\n# | I/B-09.II-D    | [7.71583, 46.10139] | CH      | 1861         | 4506   | Weisshorn      | 1235       | Valais        | Weisshorn-Matterhorn |\n# | I/B-09.II-A    | [7.65861, 45.97639] | CH/IT   | 1865         | 4478   | Matterhorn     | 1042       | Valais/Aosta  | Weisshorn-Matterhorn |\n# | I/B-09.II-C    | [7.61194, 46.03417] | CH      | 1862         | 4357   | Dent Blanche   | 915        | Valais        | Weisshorn-Matterhorn |\n# | I/B-09.I-B     | [7.29917, 45.9375]  | CH      | 1859         | 4314   | Grand Combin   | 1517       | Valais        | Grand Combin Alps    |\n# | I/B-12.II-A    | [8.12611, 46.53722] | CH      | 1829         | 4274   | Finsteraarhorn | 2280       | Bern/Valais   | Bernese Alps         |\n# | I/B-09.II-D    | [7.69028, 46.065]   | CH      | 1864         | 4221   | Zinalrothorn   | 490        | Valais        | Weisshorn-Matterhorn |\n# +----------------+---------------------+---------+--------------+--------+----------------+------------+---------------+----------------------+\n```\n\n\n#### Trio\n\n```python\nimport trio\n\nfrom cratedb_async.client import CrateClient\n\n\nasync def main():\n    crate = CrateClient('http://192.168.88.251:4200')\n    response = await crate.query('SELECT * FROM sys.summits')\n    print(response.as_table())\n\ntrio.run(main)\n\n# +----------------+---------------------+---------+--------------+--------+----------------+------------+---------------+----------------------+\n# | classification | coordinates         | country | first_ascent | height | mountain       | prominence | range         | region               |\n# +----------------+---------------------+---------+--------------+--------+----------------+------------+---------------+----------------------+\n# | I/B-07.V-B     | [6.86444, 45.8325]  | FR/IT   | 1786         | 4808   | Mont Blanc     | 4695       | U-Savoy/Aosta | Mont Blanc massif    |\n# | I/B-09.III-A   | [7.86694, 45.93694] | CH      | 1855         | 4634   | Monte Rosa     | 2165       | Valais        | Monte Rosa Alps      |\n# | I/B-09.V-A     | [7.85889, 46.09389] | CH      | 1858         | 4545   | Dom            | 1046       | Valais        | Mischabel            |\n# | I/B-09.III-A   | [7.83556, 45.92222] | CH/IT   | 1861         | 4527   | Liskamm        | 376        | Valais/Aosta  | Monte Rosa Alps      |\n# | I/B-09.II-D    | [7.71583, 46.10139] | CH      | 1861         | 4506   | Weisshorn      | 1235       | Valais        | Weisshorn-Matterhorn |\n# | I/B-09.II-A    | [7.65861, 45.97639] | CH/IT   | 1865         | 4478   | Matterhorn     | 1042       | Valais/Aosta  | Weisshorn-Matterhorn |\n# | I/B-09.II-C    | [7.61194, 46.03417] | CH      | 1862         | 4357   | Dent Blanche   | 915        | Valais        | Weisshorn-Matterhorn |\n# | I/B-09.I-B     | [7.29917, 45.9375]  | CH      | 1859         | 4314   | Grand Combin   | 1517       | Valais        | Grand Combin Alps    |\n# | I/B-12.II-A    | [8.12611, 46.53722] | CH      | 1829         | 4274   | Finsteraarhorn | 2280       | Bern/Valais   | Bernese Alps         |\n# | I/B-09.II-D    | [7.69028, 46.065]   | CH      | 1864         | 4221   | Zinalrothorn   | 490        | Valais        | Weisshorn-Matterhorn |\n# +----------------+---------------------+---------+--------------+--------+----------------+------------+---------------+----------------------+\n\n```\n\n#### Bulk insert\n\n```python\nimport asyncio\n\nfrom cratedb_async.client import CrateClient\n\n\nasync def main():\n    crate = CrateClient('http://192.168.88.251:4200')\n    rows = [\n        ('one', 2, ['three', ]),\n        ('three', 4, ['five', ])\n    ]\n    table_name = 'my_tbl'\n    \n    create_table_resp = await crate.query(f'create table {table_name} (one text, two integer, three array(TEXT))')\n    print(create_table_resp)\n    # SQLResponse(error=None, columns=[], row_count=1, duration=177.55101)\n\n    response = await crate.bulk_insert(table_name, rows)\n    print(response)\n    # SQLResponse(error=None, columns=[], row_count=0, duration=6.341763)\n\n    await crate.query(f'refresh table {table_name}')\n\n    select_response = await crate.query(f'select * from {table_name}')\n    print(select_response.as_table())\n    # SQLResponse(error=None, columns=[], row_count=1, duration=8.724443)\n\nasyncio.run(main())\n```\n\n## Style guide\nThis project uses Google Python Style guide with minor tweaks, enforced by pyling, read more in\n* Google documentation: https://google.github.io/styleguide/pyguide.html\n* Docstring documentation: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html\n\n### Tweaks\n* Max line is 100\n* Indentation is four spaces.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurister%2Fcratedb-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsurister%2Fcratedb-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurister%2Fcratedb-async/lists"}