Name | ydb-dbapi JSON |
Version |
0.1.3
JSON |
| download |
home_page | None |
Summary | YDB Python DBAPI which complies with PEP 249 |
upload_time | 2024-11-19 12:11:03 |
maintainer | None |
docs_url | None |
author | Yandex LLC |
requires_python | <4.0,>=3.8 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# YDB Python DBAPI
## Introduction
Python DBAPI to `YDB`, which provides both sync and async drivers and complies with [PEP249](https://www.python.org/dev/peps/pep-0249/).
## Installation
```shell
pip install ydb-dbapi
```
## Usage
To establish a new DBAPI connection you should provide `host`, `port` and `database`:
```python
import ydb_dbapi
connection = ydb_dbapi.connect(
host="localhost", port="2136", database="/local"
) # sync connection
async_connection = await ydb_dbapi.async_connect(
host="localhost", port="2136", database="/local"
) # async connection
```
Usage of connection:
```python
with connection.cursor() as cursor:
cursor.execute("SELECT id, val FROM table")
row = cursor.fetchone()
rows = cursor.fetchmany(size=5)
rows = cursor.fetchall()
```
Usage of async connection:
```python
async with async_connection.cursor() as cursor:
await cursor.execute("SELECT id, val FROM table")
row = await cursor.fetchone()
rows = await cursor.fetchmany(size=5)
rows = await cursor.fetchall()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "ydb-dbapi",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Yandex LLC",
"author_email": "ydb@yandex-team.ru",
"download_url": "https://files.pythonhosted.org/packages/bd/a0/2d4b232819f0d0a5a9a9ef7899701ea376778d75ae51fccd854174fe9599/ydb_dbapi-0.1.3.tar.gz",
"platform": null,
"description": "# YDB Python DBAPI\n\n## Introduction\n\nPython DBAPI to `YDB`, which provides both sync and async drivers and complies with [PEP249](https://www.python.org/dev/peps/pep-0249/).\n\n## Installation\n\n```shell\npip install ydb-dbapi\n```\n\n## Usage\n\nTo establish a new DBAPI connection you should provide `host`, `port` and `database`:\n\n```python\nimport ydb_dbapi\n\nconnection = ydb_dbapi.connect(\n host=\"localhost\", port=\"2136\", database=\"/local\"\n) # sync connection\n\nasync_connection = await ydb_dbapi.async_connect(\n host=\"localhost\", port=\"2136\", database=\"/local\"\n) # async connection\n```\n\nUsage of connection:\n\n```python\nwith connection.cursor() as cursor:\n cursor.execute(\"SELECT id, val FROM table\")\n\n row = cursor.fetchone()\n rows = cursor.fetchmany(size=5)\n rows = cursor.fetchall()\n```\n\nUsage of async connection:\n\n```python\nasync with async_connection.cursor() as cursor:\n await cursor.execute(\"SELECT id, val FROM table\")\n\n row = await cursor.fetchone()\n rows = await cursor.fetchmany(size=5)\n rows = await cursor.fetchall()\n```\n\n",
"bugtrack_url": null,
"license": null,
"summary": "YDB Python DBAPI which complies with PEP 249",
"version": "0.1.3",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6ee684a224aaf1730d21ff80d53f0a88a1a00c84733a42edbd3464bc55025985",
"md5": "d4e795ec130e2c52062267f794ab9d2d",
"sha256": "d1c46150f8b0198f2961f042fd1cc0c0ff19821877d98c4015238ff0443e17db"
},
"downloads": -1,
"filename": "ydb_dbapi-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d4e795ec130e2c52062267f794ab9d2d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 14798,
"upload_time": "2024-11-19T12:10:58",
"upload_time_iso_8601": "2024-11-19T12:10:58.571477Z",
"url": "https://files.pythonhosted.org/packages/6e/e6/84a224aaf1730d21ff80d53f0a88a1a00c84733a42edbd3464bc55025985/ydb_dbapi-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bda02d4b232819f0d0a5a9a9ef7899701ea376778d75ae51fccd854174fe9599",
"md5": "ef51e4eb3cb4405e71aae52f0fcba70e",
"sha256": "a714f7d062309d90cd4f504471494ee8b456bcc2e82c7ab0e02339d2445b6fb9"
},
"downloads": -1,
"filename": "ydb_dbapi-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "ef51e4eb3cb4405e71aae52f0fcba70e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 14030,
"upload_time": "2024-11-19T12:11:03",
"upload_time_iso_8601": "2024-11-19T12:11:03.027309Z",
"url": "https://files.pythonhosted.org/packages/bd/a0/2d4b232819f0d0a5a9a9ef7899701ea376778d75ae51fccd854174fe9599/ydb_dbapi-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-19 12:11:03",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "ydb-dbapi"
}