{ "info": { "author": "Konstantin Lebedev", "author_email": "kostyan.lebedev@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: SQL", "Topic :: Database", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Software Development", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# aioch\n**aioch** is a library for accessing a ClickHouse database over native interface from the asyncio.\nIt wraps features of [clickhouse-driver](https://github.com/mymarilyn/clickhouse-driver) for asynchronous usage.\n\n[![Coverage Status](https://coveralls.io/repos/github/mymarilyn/aioch/badge.svg?branch=master)](https://coveralls.io/github/mymarilyn/aioch?branch=master)\n[![Build Status](https://travis-ci.org/mymarilyn/aioch.svg?branch=master)](https://travis-ci.org/mymarilyn/aioch)\n\n\n## Installation\n\nThe package can be installed using `pip`:\n\n```bash\npip install aioch\n```\n\nTo install from source:\n\n```bash\ngit clone https://github.com/mymarilyn/aioch\ncd aioch\npython setup.py install\n```\n\n## Usage\n```python\nfrom datetime import datetime\n\nimport asyncio\nfrom aioch import Client\n\n\nasync def exec_progress():\n client = Client('localhost')\n\n progress = await client.execute_with_progress('LONG AND COMPLICATED QUERY')\n timeout = 20\n started_at = datetime.now()\n\n async for num_rows, total_rows in progress:\n done = num_rows / total_rows if total_rows else total_rows\n now = datetime.now()\n # Cancel query if it takes more than 20 seconds to process 50% of rows.\n if (now - started_at).total_seconds() > timeout and done < 0.5:\n await client.cancel()\n break\n else:\n rv = await progress.get_result()\n print(rv)\n\n\nasync def exec_no_progress():\n client = Client('localhost')\n rv = await client.execute('LONG AND COMPLICATED QUERY')\n print(rv)\n\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(asyncio.wait([exec_progress(), exec_no_progress()]))\n```\n\nFor more information see **clickhouse-driver** usage examples.\n\n## Parameters\n\n* `executor` - instance of custom Executor, if not supplied default executor will be used\n* `loop` - asyncio compatible event loop\n\nOther parameters are passing to wrapped clickhouse-driver's Client.\n\n## License\n\naioch is distributed under the [MIT license](http://www.opensource.org/licenses/mit-license.php).", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mymarilyn/aioch", "keywords": "ClickHouse db database cloud analytics asyncio", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "aioch", "package_url": "https://pypi.org/project/aioch/", "platform": "", "project_url": "https://pypi.org/project/aioch/", "project_urls": { "Homepage": "https://github.com/mymarilyn/aioch" }, "release_url": "https://pypi.org/project/aioch/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "Library for accessing a ClickHouse database over native interface from the asyncio", "version": "0.0.1" }, "last_serial": 3208040, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "dd2d389687e217bac7a6cd81f357bf9a", "sha256": "0baa147a80d0a5a23c5b477ef85c0520726bc04654cff6e2eb6afdbe952b04c0" }, "downloads": -1, "filename": "aioch-0.0.1.tar.gz", "has_sig": false, "md5_digest": "dd2d389687e217bac7a6cd81f357bf9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4068, "upload_time": "2017-09-27T19:07:50", "url": "https://files.pythonhosted.org/packages/4e/31/5b2140ae33f5f9dabf38ceb8ef99cd90d9a52aee743eda2f225605e7350f/aioch-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dd2d389687e217bac7a6cd81f357bf9a", "sha256": "0baa147a80d0a5a23c5b477ef85c0520726bc04654cff6e2eb6afdbe952b04c0" }, "downloads": -1, "filename": "aioch-0.0.1.tar.gz", "has_sig": false, "md5_digest": "dd2d389687e217bac7a6cd81f357bf9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4068, "upload_time": "2017-09-27T19:07:50", "url": "https://files.pythonhosted.org/packages/4e/31/5b2140ae33f5f9dabf38ceb8ef99cd90d9a52aee743eda2f225605e7350f/aioch-0.0.1.tar.gz" } ] }