ydb-dbapi


Nameydb-dbapi JSON
Version 0.1.8 PyPI version JSON
download
home_pageNone
SummaryYDB Python DBAPI which complies with PEP 249
upload_time2025-02-19 06:53:34
maintainerNone
docs_urlNone
authorYandex LLC
requires_python<4.0,>=3.8
licenseNone
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/4b/3e/6f09ba084fbd5bd46be398146e6618e5c0cc229c296c4c07fd214c0315eb/ydb_dbapi-0.1.8.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.8",
    "project_urls": {
        "Repository": "https://github.com/ydb-platform/ydb-python-dbapi/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "47d28438be7abe005788b76b3a7882999ef7e9265688c0af546f2f9a48b7eba1",
                "md5": "56315ec284be5a01c0d508d3732b8c66",
                "sha256": "a08182c2f095abf30cb371783a30def2a4deeaef488115b8293b49449db32c1c"
            },
            "downloads": -1,
            "filename": "ydb_dbapi-0.1.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "56315ec284be5a01c0d508d3732b8c66",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 15234,
            "upload_time": "2025-02-19T06:53:32",
            "upload_time_iso_8601": "2025-02-19T06:53:32.751168Z",
            "url": "https://files.pythonhosted.org/packages/47/d2/8438be7abe005788b76b3a7882999ef7e9265688c0af546f2f9a48b7eba1/ydb_dbapi-0.1.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b3e6f09ba084fbd5bd46be398146e6618e5c0cc229c296c4c07fd214c0315eb",
                "md5": "f0374320ba3bb6a1f003bacad4b22085",
                "sha256": "92d31ef3dcdb56c39697d5fb3d1d064ca4800b9bc8732e20eea0b7cdee40dd06"
            },
            "downloads": -1,
            "filename": "ydb_dbapi-0.1.8.tar.gz",
            "has_sig": false,
            "md5_digest": "f0374320ba3bb6a1f003bacad4b22085",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 14127,
            "upload_time": "2025-02-19T06:53:34",
            "upload_time_iso_8601": "2025-02-19T06:53:34.900573Z",
            "url": "https://files.pythonhosted.org/packages/4b/3e/6f09ba084fbd5bd46be398146e6618e5c0cc229c296c4c07fd214c0315eb/ydb_dbapi-0.1.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-19 06:53:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ydb-platform",
    "github_project": "ydb-python-dbapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ydb-dbapi"
}
        
Elapsed time: 2.17277s