{ "info": { "author": "INADA Naoki", "author_email": "songofacandy@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Trio", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Database" ], "description": ".. image:: https://readthedocs.org/projects/trio_mysql/badge/?version=latest\n :target: http://trio_mysql.readthedocs.io/\n :alt: Documentation Status\n\n.. image:: https://travis-ci.org/python-trio/trio-mysql.svg?branch=master\n :target: https://travis-ci.org/python-trio/trio-mysql\n\n.. image:: https://codecov.io/gh/python-trio/trio-mysql/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/python-trio/trio-mysql\n\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\n :target: https://github.com/python-trio/trio-mysql/blob/master/LICENSE\n\n\nTrio-MySQL\n==========\n\n.. contents:: Table of Contents\n :local:\n\nThis package contains a pure-Python and Trio-enhanced MySQL client library.\nIt is a mostly-straightforward clone of PyMySQL, adding async methods\ncompatible with the Trio framework.\n\nNOTE: Trio-MySQL tries to adhere to (an async version of) the high level\ndatabase APIs defined in `PEP 249`_. Some differences, however, are\nunavoidable.\n\n.. _`PEP 249`: https://www.python.org/dev/peps/pep-0249/\n\n\nRequirements\n-------------\n\n* Python -- one of the following:\n\n - CPython_ >= 3.5\n - PyPy_ >= 5.5\n\n* MySQL Server -- one of the following:\n\n - MySQL_ >= 5.5\n - MariaDB_ >= 5.5\n\n.. _CPython: https://www.python.org/\n.. _PyPy: https://pypy.org/\n.. _MySQL: https://www.mysql.com/\n.. _MariaDB: https://mariadb.org/\n\n\nInstallation\n------------\n\nPackage is uploaded on `PyPI `_.\n\nYou can install it with pip::\n\n $ python3 -m pip install trio_mysql\n\nTo use \"sha256_password\" or \"caching_sha2_password\" for authenticate,\nyou need to install additional dependency::\n\n $ python3 -m pip install trio_mysql[rsa]\n\n\nDocumentation\n-------------\n\nDocumentation is available online: http://trio_mysql.readthedocs.io/\n\nFor support, please refer to the `StackOverflow\n`_.\n\nExample\n-------\n\nThe following examples make use of a simple table\n\n.. code:: sql\n\n CREATE TABLE `users` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `email` varchar(255) COLLATE utf8_bin NOT NULL,\n `password` varchar(255) COLLATE utf8_bin NOT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin\n AUTO_INCREMENT=1 ;\n\n\n.. code:: python\n\n import trio_mysql.cursors\n\n # Connect to the database\n connection = trio_mysql.connect(host='localhost',\n user='user',\n password='passwd',\n db='db',\n charset='utf8mb4',\n cursorclass=trio_mysql.cursors.DictCursor)\n\n async with connection as conn:\n async with conn.cursor() as cursor:\n # Create a new record\n sql = \"INSERT INTO `users` (`email`, `password`) VALUES (%s, %s)\"\n await cursor.execute(sql, ('webmaster@python.org', 'very-secret'))\n\n # connection is not autocommit by default. So you must commit to save\n # your changes.\n conn.commit()\n\n # Alternately, you can set up a transaction:\n async with conn.transaction():\n async with conn.cursor() as cursor:\n # Create a new record\n sql = \"INSERT INTO `users` (`email`, `password`) VALUES (%s, %s)\"\n await cursor.execute(sql, ('webmistress@python.org', 'totally-secret'))\n\n async with conn.cursor() as cursor:\n # Read a single record\n sql = \"SELECT `id`, `password` FROM `users` WHERE `email`=%s\"\n await cursor.execute(sql, ('webmaster@python.org',))\n result = await cursor.fetchone()\n print(result)\n\nThis example will print:\n\n.. code:: python\n\n {'password': 'very-secret', 'id': 1}\n\n\nResources\n---------\n\n* DB-API 2.0: https://www.python.org/dev/peps/pep-0249/\n\n* MySQL Reference Manuals: https://dev.mysql.com/doc/\n\n* MySQL client/server protocol:\n https://dev.mysql.com/doc/internals/en/client-server-protocol.html\n\n* \"Connector\" channel in MySQL Community Slack:\n https://lefred.be/mysql-community-on-slack/\n\nTrio chat: https://gitter.im/python-trio/general\n\nLicense\n-------\n\nTrio-MySQL is released under the MIT License. See LICENSE for more information.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/python-trio/trio-mysql/", "keywords": "MySQL", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "trio_mysql", "package_url": "https://pypi.org/project/trio_mysql/", "platform": "", "project_url": "https://pypi.org/project/trio_mysql/", "project_urls": { "Homepage": "https://github.com/python-trio/trio-mysql/" }, "release_url": "https://pypi.org/project/trio_mysql/0.9.3/", "requires_dist": null, "requires_python": "", "summary": "Pure Python MySQL Driver", "version": "0.9.3" }, "last_serial": 5892285, "releases": { "0.8.0": [ { "comment_text": "", "digests": { "md5": "c1113ea638b5a973ff4c490bcb5eb3ee", "sha256": "c4505166b01a5d43cfe67e54ab00f72177d0dc0b38734b3c41de87b0f1ef2cde" }, "downloads": -1, "filename": "trio_mysql-0.8.0.tar.gz", "has_sig": false, "md5_digest": "c1113ea638b5a973ff4c490bcb5eb3ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 74078, "upload_time": "2018-03-10T17:41:50", "url": "https://files.pythonhosted.org/packages/eb/ee/a24293fae622f068fd62c7fcd2e21b43dc150d622a1838851196584cac99/trio_mysql-0.8.0.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "15513cd8650b41f34af460e04c3ca35e", "sha256": "0a63e32a508f057529d75f6c5a1bbeb020052a16a299e05f34a14de800a82a95" }, "downloads": -1, "filename": "trio_mysql-0.9.3.tar.gz", "has_sig": false, "md5_digest": "15513cd8650b41f34af460e04c3ca35e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 91860, "upload_time": "2019-09-26T19:17:17", "url": "https://files.pythonhosted.org/packages/5f/f7/4dde4bb412662a487ffdbe0dd726e40c8bc3bd6444dede52f5e8443ccaab/trio_mysql-0.9.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "15513cd8650b41f34af460e04c3ca35e", "sha256": "0a63e32a508f057529d75f6c5a1bbeb020052a16a299e05f34a14de800a82a95" }, "downloads": -1, "filename": "trio_mysql-0.9.3.tar.gz", "has_sig": false, "md5_digest": "15513cd8650b41f34af460e04c3ca35e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 91860, "upload_time": "2019-09-26T19:17:17", "url": "https://files.pythonhosted.org/packages/5f/f7/4dde4bb412662a487ffdbe0dd726e40c8bc3bd6444dede52f5e8443ccaab/trio_mysql-0.9.3.tar.gz" } ] }