{ "info": { "author": "Nikolay Novik", "author_email": "nickolainovik@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: AsyncIO", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Database", "Topic :: Database :: Front-Ends" ], "description": "aioodbc\n=======\n.. image:: https://travis-ci.com/aio-libs/aioodbc.svg?branch=master\n :target: https://travis-ci.com/aio-libs/aioodbc\n.. image:: https://coveralls.io/repos/aio-libs/aioodbc/badge.svg?branch=master&service=github\n :target: https://coveralls.io/github/aio-libs/aioodbc?branch=master\n.. image:: https://img.shields.io/pypi/v/aioodbc.svg\n :target: https://pypi.python.org/pypi/aioodbc\n.. image:: https://badges.gitter.im/Join%20Chat.svg\n :target: https://gitter.im/aio-libs/Lobby\n :alt: Chat on Gitter\n\n**aioodbc** is a Python 3.5+ module that makes it possible to access ODBC_ databases\nwith asyncio_. It relies on the awesome pyodbc_ library and preserves the same look and\nfeel. *aioodbc* was written using `async/await` syntax (PEP492_) and thus is not compatible\nwith Python versions older than 3.5. Internally *aioodbc* employs threads to avoid\nblocking the event loop, threads_ are not that as bad as you think!. Other\ndrivers like motor_ use the same approach.\n\n**aioodbc** is fully compatible and tested with uvloop_. Take a look at the test\nsuite, all tests are executed with both the default event loop and uvloop_.\n\nSupported Databases\n-------------------\n\n**aioodbc** should work with all databases supported by pyodbc_. But for now the\nlibrary has been tested with: **SQLite**, **MySQL** and **PostgreSQL**. Feel\nfree to add other databases to the test suite by submitting a PR.\n\n\nCommunity\n---------\nMailing List: https://groups.google.com/forum/#!forum/aio-libs\n\nChat room: https://gitter.im/aio-libs/Lobby\n\n\nBasic Example\n-------------\n\n**aioodbc** is based on pyodbc_ and provides the same api, you just need\nto use ``yield from conn.f()`` or ``await conn.f()`` instead of ``conn.f()``\n\nProperties are unchanged, so ``conn.prop`` is correct as well as\n``conn.prop = val``.\n\n\n.. code:: python\n\n import asyncio\n import aioodbc\n\n\n loop = asyncio.get_event_loop()\n\n\n async def test_example():\n dsn = 'Driver=SQLite;Database=sqlite.db'\n conn = await aioodbc.connect(dsn=dsn, loop=loop)\n\n cur = await conn.cursor()\n await cur.execute(\"SELECT 42 AS age;\")\n rows = await cur.fetchall()\n print(rows)\n print(rows[0])\n print(rows[0].age)\n await cur.close()\n await conn.close()\n\n loop.run_until_complete(test_example())\n\n\nConnection Pool\n---------------\nConnection pooling is ported from aiopg_ and relies on PEP492_ features:\n\n.. code:: python\n\n import asyncio\n import aioodbc\n\n\n loop = asyncio.get_event_loop()\n\n\n async def test_pool():\n dsn = 'Driver=SQLite;Database=sqlite.db'\n pool = await aioodbc.create_pool(dsn=dsn, loop=loop)\n\n async with pool.acquire() as conn:\n cur = await conn.cursor()\n await cur.execute(\"SELECT 42;\")\n r = await cur.fetchall()\n print(r)\n await cur.close()\n await conn.close()\n pool.close()\n await pool.wait_closed()\n\n loop.run_until_complete(test_pool())\n\n\nContext Managers\n----------------\n`Pool`, `Connection` and `Cursor` objects support the context management\nprotocol:\n\n.. code:: python\n\n import asyncio\n import aioodbc\n\n\n loop = asyncio.get_event_loop()\n\n\n async def test_example():\n dsn = 'Driver=SQLite;Database=sqlite.db'\n\n async with aioodbc.create_pool(dsn=dsn, loop=loop) as pool:\n async with pool.acquire() as conn:\n async with conn.cursor() as cur:\n await cur.execute('SELECT 42 AS age;')\n val = await cur.fetchone()\n print(val)\n print(val.age)\n\n loop.run_until_complete(test_example())\n\n\nInstallation\n------------\n\nIn a linux environment pyodbc_ (hence *aioodbc*) requires the unixODBC_ library.\nYou can install it using your package manager, for example::\n\n $ sudo apt-get install unixodbc\n $ sudo apt-get install unixodbc-dev\n\nthen::\n\n pip install aioodbc\n\n\nRun tests\n---------\n\nFor testing purposes you need to install docker_ and the development\nrequirements::\n\n $ pip install -r requirements-dev.txt\n\nIn order to simplify development you should install the provided docker container.\nThis way you don't need to install any databases or other system libraries, everything happens inside the container.\n\nThen just execute::\n\n $ make docker_build\n $ make docker_test\n\nThe test will automatically pull images and build containers with\nthe required databases.\n\n*NOTE:* Running tests requires Python 3.6 or higher.\n\n\nOther SQL Drivers\n-----------------\n\n* aiopg_ - asyncio client for PostgreSQL\n* aiomysql_ - asyncio client form MySQL\n\n\nRequirements\n------------\n\n* Python_ 3.5+\n* pyodbc_\n* uvloop_ (optional)\n\n\n.. _Python: https://www.python.org\n.. _asyncio: http://docs.python.org/3.4/library/asyncio.html\n.. _pyodbc: https://github.com/mkleehammer/pyodbc\n.. _uvloop: https://github.com/MagicStack/uvloop\n.. _ODBC: https://en.wikipedia.org/wiki/Open_Database_Connectivity\n.. _aiopg: https://github.com/aio-libs/aiopg\n.. _aiomysql: https://github.com/aio-libs/aiomysql\n.. _PEP492: https://www.python.org/dev/peps/pep-0492/\n.. _unixODBC: http://www.unixodbc.org/\n.. _threads: http://techspot.zzzeek.org/2015/02/15/asynchronous-python-and-databases/\n.. _docker: https://docs.docker.com/engine/installation/\n.. _motor: https://emptysqua.re/blog/motor-0-7-beta/\n\nChanges\n-------\n\n0.3.3 (2019-07-05)\n^^^^^^^^^^^^^^^^^^\n* Parameter echo passed properly in cursor #185\n* Close bad connections before returning back to pool #195\n\n0.3.2 (2018-08-04)\n^^^^^^^^^^^^^^^^^^\n* Added basic documentation for after_created and ThreadPoolExecutor #176 (thanks @AlexHagerman)\n* Cursor/connection context managers now rollback transaction on error,\n otherwise commit if autocommit=False #178 (thanks @julianit)\n\n\n0.3.1 (2018-03-23)\n^^^^^^^^^^^^^^^^^^\n* Add after_create hook for connection configuration (thanks @lanfon72)\n\n\n0.3.0 (2018-02-23)\n^^^^^^^^^^^^^^^^^^\n* Added optional pool connections recycling #167 (thanks @drpoggi)\n\n\n0.2.0 (2017-06-24)\n^^^^^^^^^^^^^^^^^^\n* Fixed Cursor.execute returns a pyodbc.Cursor instead of itself #114\n* Fixed __aiter__ to not be awaitable for python>=3.5.2 #113\n* Tests now using aiodocker #106\n\n\n0.1.0 (2017-04-30)\n^^^^^^^^^^^^^^^^^^\n* Fixed project version\n\n\n0.0.4 (2017-04-30)\n^^^^^^^^^^^^^^^^^^\n* Improved mysql testing\n\n\n0.0.3 (2016-07-05)\n^^^^^^^^^^^^^^^^^^\n* Dockerize tests, now we can add more DBs to tests using docker #15, #17, #19\n* Test suite executed with both default asyncio and uvloop #18\n\n\n0.0.2 (2016-01-01)\n^^^^^^^^^^^^^^^^^^\n* Improved pep 492 support.\n* pool.get method removed, use acquire instead.\n* Added tests against MySQL.\n* Added bunch of doc strings.\n\n\n0.0.1 (2015-10-12)\n^^^^^^^^^^^^^^^^^^\n* Initial release.", "description_content_type": "", "docs_url": null, "download_url": "https://pypi.python.org/pypi/aioodbc", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aio-libs/aioodbc", "keywords": "", "license": "Apache 2", "maintainer": "", "maintainer_email": "", "name": "aioodbc", "package_url": "https://pypi.org/project/aioodbc/", "platform": "POSIX", "project_url": "https://pypi.org/project/aioodbc/", "project_urls": { "Download": "https://pypi.python.org/pypi/aioodbc", "Homepage": "https://github.com/aio-libs/aioodbc" }, "release_url": "https://pypi.org/project/aioodbc/0.3.3/", "requires_dist": null, "requires_python": ">=3.5", "summary": "ODBC driver for asyncio.", "version": "0.3.3" }, "last_serial": 5493850, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "8e13d4a7158011c3dd6dbee6bdb002fc", "sha256": "837816d9646dd381915eaa339e27389fc4c3df4d546f0790b8d786ea37713b75" }, "downloads": -1, "filename": "aioodbc-0.0.1.tar.gz", "has_sig": false, "md5_digest": "8e13d4a7158011c3dd6dbee6bdb002fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17833, "upload_time": "2015-10-12T18:40:21", "url": "https://files.pythonhosted.org/packages/1c/b9/ace10eefe306eb25265189110b02d54bf9a397d2c9e472443fa23e569ee1/aioodbc-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "c6f87ffcc3cdb0ddf2f5b581bab752fb", "sha256": "983a698e3a600f147ec68e77f41015e04a649565d2fa09e9707691e129f309aa" }, "downloads": -1, "filename": "aioodbc-0.0.2.tar.gz", "has_sig": false, "md5_digest": "c6f87ffcc3cdb0ddf2f5b581bab752fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21032, "upload_time": "2016-01-01T11:00:53", "url": "https://files.pythonhosted.org/packages/57/25/c8ba50db50ba532e554534bfd8f8f2ac639cb52056597af4a316d7a57853/aioodbc-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "f6120baeee36f86835c4a5f070bedc1a", "sha256": "f4a2e123c066f3d95922982349e9c6dfe169f87cd72689482e27c4cfbe6585a0" }, "downloads": -1, "filename": "aioodbc-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f6120baeee36f86835c4a5f070bedc1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16808, "upload_time": "2016-07-05T21:03:55", "url": "https://files.pythonhosted.org/packages/4b/ca/c7c9ff5b0153b8e41631dac37ecda641eb866a0a132f13709ae06cbd37e4/aioodbc-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "e42364ef8a967b04c45dfa7d1af155b5", "sha256": "898aa8299a12ae96f6ba8c2ae47c4b138cd95b66ab2f5d9170a2a3d3b183ce87" }, "downloads": -1, "filename": "aioodbc-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e42364ef8a967b04c45dfa7d1af155b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17297, "upload_time": "2017-04-30T19:09:43", "url": "https://files.pythonhosted.org/packages/9b/4a/dc87d3a051691accac50f22782bf1ab9dcd310f50c58118804e2ada24716/aioodbc-0.1.0.tar.gz" } ], "0.1.0a0": [ { "comment_text": "", "digests": { "md5": "7582bcb70ed238a044bb64d81c514eae", "sha256": "88eba5012acbaeca4d8618f22c2ce5c7d412b9d254777ef5ee29007fdaed3546" }, "downloads": -1, "filename": "aioodbc-0.1.0a0.tar.gz", "has_sig": false, "md5_digest": "7582bcb70ed238a044bb64d81c514eae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17254, "upload_time": "2017-04-30T18:55:18", "url": "https://files.pythonhosted.org/packages/1e/7d/33d829151bc2fe124a422ce0eda861adfb9733728edb5308606f5cc36642/aioodbc-0.1.0a0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "fb3dd704b28f5caa3d3855e2e1796992", "sha256": "1a859a4ac7de85bb7a743e22da3942fb046c18fed27fb68bb2ac01750ed259a7" }, "downloads": -1, "filename": "aioodbc-0.2.0.tar.gz", "has_sig": false, "md5_digest": "fb3dd704b28f5caa3d3855e2e1796992", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17650, "upload_time": "2017-06-24T12:56:56", "url": "https://files.pythonhosted.org/packages/db/8c/420f01059a10a014e03987ff6fcf66f1cdd82e245d46ddac2d3609aa0c3b/aioodbc-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "d2772f41c48efedea6b8d156389a3cdb", "sha256": "92a5923e5a952d0bbe855ae8081f39bb7dd859716167638830980500b4e1e1b5" }, "downloads": -1, "filename": "aioodbc-0.3.0.tar.gz", "has_sig": false, "md5_digest": "d2772f41c48efedea6b8d156389a3cdb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 18159, "upload_time": "2018-02-23T19:58:53", "url": "https://files.pythonhosted.org/packages/60/ba/07e4bd912364b22529fc6467f2866661e9e2553390794c9d95f8fab3748d/aioodbc-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "8e4e352039cffc2b7afa045ab7f5d22b", "sha256": "a18e3c7308b20de2b86c72c4527b7f4943ab7b206e513ba7a59878d538ae92f4" }, "downloads": -1, "filename": "aioodbc-0.3.1.tar.gz", "has_sig": false, "md5_digest": "8e4e352039cffc2b7afa045ab7f5d22b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 18297, "upload_time": "2018-03-23T20:41:15", "url": "https://files.pythonhosted.org/packages/ab/ee/f88ad6eefeda4ee9ef4d32fe880be73fb467d12839918c18437a290e26dd/aioodbc-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "a92de73a9b1c4f7a4ea8a5ba62b67245", "sha256": "4b1cf09b79efdf643489b1813e0edba92d8e5786c47255721623c4e4da1e7ab6" }, "downloads": -1, "filename": "aioodbc-0.3.2.tar.gz", "has_sig": false, "md5_digest": "a92de73a9b1c4f7a4ea8a5ba62b67245", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 18540, "upload_time": "2018-08-04T20:31:33", "url": "https://files.pythonhosted.org/packages/2f/c6/1fff874b0947e0fa07b419899b0e75083c4eb691234b8eac92bae438eb0a/aioodbc-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "3785bd7a758c803735361f5b5417843b", "sha256": "16d5dcc529a5a8dd91cf96d73521d0408c59f4289a81254bad155e1b3142584f" }, "downloads": -1, "filename": "aioodbc-0.3.3.tar.gz", "has_sig": false, "md5_digest": "3785bd7a758c803735361f5b5417843b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 19037, "upload_time": "2019-07-06T03:18:00", "url": "https://files.pythonhosted.org/packages/0f/d9/1e4d1582a059f72b24a0bcad08c6aec8109a6d69e888155a7968833abe91/aioodbc-0.3.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3785bd7a758c803735361f5b5417843b", "sha256": "16d5dcc529a5a8dd91cf96d73521d0408c59f4289a81254bad155e1b3142584f" }, "downloads": -1, "filename": "aioodbc-0.3.3.tar.gz", "has_sig": false, "md5_digest": "3785bd7a758c803735361f5b5417843b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 19037, "upload_time": "2019-07-06T03:18:00", "url": "https://files.pythonhosted.org/packages/0f/d9/1e4d1582a059f72b24a0bcad08c6aec8109a6d69e888155a7968833abe91/aioodbc-0.3.3.tar.gz" } ] }