This commit is contained in:
macbook_max
2026-10-15 20:36:59 +08:00
commit 6bf949949c
7923 changed files with 1369582 additions and 0 deletions
@@ -0,0 +1,150 @@
Metadata-Version: 2.4
Name: aiomysql
Version: 0.3.2
Summary: MySQL driver for asyncio.
Author-email: Nikolay Novik <nickolainovik@gmail.com>
License-Expression: MIT
Project-URL: homepage, https://github.com/aio-libs/aiomysql
Project-URL: source, https://github.com/aio-libs/aiomysql
Project-URL: download, https://pypi.python.org/pypi/aiomysql
Project-URL: changelog, https://github.com/aio-libs/aiomysql/blob/main/CHANGES.txt
Project-URL: documentation, https://aiomysql.readthedocs.io/
Project-URL: issues, https://github.com/aio-libs/aiomysql/issues
Project-URL: GitHub: CI, https://github.com/aio-libs/aiomysql/actions
Project-URL: GitHub: discussions, https://github.com/aio-libs/aiomysql/discussions
Keywords: mysql,mariadb,asyncio,aiomysql
Platform: POSIX
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: POSIX
Classifier: Environment :: Web Environment
Classifier: Development Status :: 3 - Alpha
Classifier: Topic :: Database
Classifier: Topic :: Database :: Front-Ends
Classifier: Framework :: AsyncIO
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: PyMySQL>=1.0
Provides-Extra: sa
Requires-Dist: sqlalchemy<1.4,>=1.3; extra == "sa"
Provides-Extra: rsa
Requires-Dist: PyMySQL[rsa]>=1.0; extra == "rsa"
Dynamic: license-file
aiomysql
========
.. image:: https://github.com/aio-libs/aiomysql/actions/workflows/ci-cd.yml/badge.svg?branch=main
:target: https://github.com/aio-libs/aiomysql/actions/workflows/ci-cd.yml
.. image:: https://codecov.io/gh/aio-libs/aiomysql/branch/main/graph/badge.svg
:target: https://codecov.io/gh/aio-libs/aiomysql
:alt: Code coverage
.. image:: https://badge.fury.io/py/aiomysql.svg
:target: https://badge.fury.io/py/aiomysql
:alt: Latest Version
.. image:: https://readthedocs.org/projects/aiomysql/badge/?version=latest
:target: https://aiomysql.readthedocs.io/
:alt: Documentation Status
.. image:: https://badges.gitter.im/Join%20Chat.svg
:target: https://gitter.im/aio-libs/Lobby
:alt: Chat on Gitter
**aiomysql** is a "driver" for accessing a `MySQL` database
from the asyncio_ (PEP-3156/tulip) framework. It depends on and reuses most
parts of PyMySQL_ . *aiomysql* tries to be like awesome aiopg_ library and
preserve same api, look and feel.
Internally **aiomysql** is copy of PyMySQL, underlying io calls switched
to async, basically ``yield from`` and ``asyncio.coroutine`` added in
proper places)). `sqlalchemy` support ported from aiopg_.
Documentation
-------------
https://aiomysql.readthedocs.io/
Basic Example
-------------
**aiomysql** based on PyMySQL_ , and provides same api, you just need
to use ``await conn.f()`` or ``yield from conn.f()`` instead of calling
``conn.f()`` for every method.
Properties are unchanged, so ``conn.prop`` is correct as well as
``conn.prop = val``.
.. code:: python
import asyncio
import aiomysql
async def test_example():
async with aiomysql.create_pool(host='127.0.0.1', port=3306,
user='root', password='',
db='mysql') as pool:
async with pool.acquire() as conn:
async with conn.cursor() as cur:
await cur.execute("SELECT 42;")
print(cur.description)
(r,) = await cur.fetchone()
assert r == 42
asyncio.run(test_example())
Example of SQLAlchemy optional integration
------------------------------------------
Sqlalchemy support has been ported from aiopg_ so api should be very familiar
for aiopg_ user.:
.. code:: python
import asyncio
import sqlalchemy as sa
from aiomysql.sa import create_engine
metadata = sa.MetaData()
tbl = sa.Table('tbl', metadata,
sa.Column('id', sa.Integer, primary_key=True),
sa.Column('val', sa.String(255)))
async def go():
engine = await create_engine(user='root', db='test_pymysql',
host='127.0.0.1', password='')
async with engine.acquire() as conn:
await conn.execute(tbl.insert().values(val='abc'))
await conn.execute(tbl.insert().values(val='xyz'))
async for row in conn.execute(tbl.select()):
print(row.id, row.val)
engine.close()
await engine.wait_closed()
asyncio.run(go())
Requirements
------------
* Python_ 3.9+
* PyMySQL_
.. _Python: https://www.python.org
.. _asyncio: http://docs.python.org/3.5/library/asyncio.html
.. _aiopg: https://github.com/aio-libs/aiopg
.. _PyMySQL: https://github.com/PyMySQL/PyMySQL
.. _Tornado-MySQL: https://github.com/PyMySQL/Tornado-MySQL
@@ -0,0 +1,77 @@
aiomysql-0.3.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
aiomysql-0.3.2.dist-info/METADATA,sha256=Gs9X6W4ukdNQxfvC2U3SwyNNcnfFPF7AdwSfrEb76X4,5051
aiomysql-0.3.2.dist-info/RECORD,,
aiomysql-0.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
aiomysql-0.3.2.dist-info/licenses/LICENSE,sha256=MUEg3GXwgA9ziksxQAx27hTezR--d86cNUCkIbhup7Y,1070
aiomysql-0.3.2.dist-info/top_level.txt,sha256=aWWBKispGRypLTGStBy2UKiAxpMBRgIx1EVUFY9HNUo,23
aiomysql/.gitignore,sha256=9iHLtD_a6XKwfLNu10aPpI21-LYbwQG8S04DJ8PJW0o,17
aiomysql/__init__.py,sha256=IveEz5O-p8iLaEvUkmsLSNM25rOmKxuz4J7gUS8lVGw,2219
aiomysql/__pycache__/__init__.cpython-311.pyc,,
aiomysql/__pycache__/_scm_version.cpython-311.pyc,,
aiomysql/__pycache__/_version.cpython-311.pyc,,
aiomysql/__pycache__/connection.cpython-311.pyc,,
aiomysql/__pycache__/cursors.cpython-311.pyc,,
aiomysql/__pycache__/log.cpython-311.pyc,,
aiomysql/__pycache__/pool.cpython-311.pyc,,
aiomysql/__pycache__/utils.cpython-311.pyc,,
aiomysql/_scm_version.py,sha256=e8NqPtZ8fggRgk3GPrqZ_U_BDV8aSULw1u_Gn9NNbnk,704
aiomysql/_scm_version.pyi,sha256=UwfFHrNq6VmZE8d1qRk9xsPfI5mBt11FPQUOBaMqlgk,125
aiomysql/_version.py,sha256=oMV4N1zz2Tam94pUAwxioFYLw0m9vnWJ46dKTJ6Pbqc,87
aiomysql/connection.py,sha256=gCtLs15Tp5tIHq3IZMsBoqa3ObAJtzrszItpbZjMvI8,52568
aiomysql/cursors.py,sha256=pMPlxD0VSU02GTZZ260cQ6BoT7x57PpvjBTd7R3pJSo,23508
aiomysql/log.py,sha256=jHJAltl-4UrBpOocVgMUf_f_moD1Yuq1yoEEYUZ6iko,122
aiomysql/pool.py,sha256=6rMRcOa0xvKaiN8a36mw8uVdUqqsZGMQFs_2UADrqLM,8402
aiomysql/sa/__init__.py,sha256=QAgff9W0fgSgyqtdTVA8xG5LAqXE5UcJss_ndyZsbHQ,561
aiomysql/sa/__pycache__/__init__.cpython-311.pyc,,
aiomysql/sa/__pycache__/connection.cpython-311.pyc,,
aiomysql/sa/__pycache__/engine.cpython-311.pyc,,
aiomysql/sa/__pycache__/exc.cpython-311.pyc,,
aiomysql/sa/__pycache__/result.cpython-311.pyc,,
aiomysql/sa/__pycache__/transaction.cpython-311.pyc,,
aiomysql/sa/connection.py,sha256=enfW3Jsznp0ICpGQtmPrl91iYvJPf6zb7XlEnWE2aBE,14895
aiomysql/sa/engine.py,sha256=4ZMlIjWbuwzUach_yV_1j2faRG1PiWTb-WnnKABr7xA,6916
aiomysql/sa/exc.py,sha256=IyQoJXnyWc298EugnlgBdDcWtEkmwHmpmCDZltitSmk,777
aiomysql/sa/result.py,sha256=q88C-F0B68ABjCOeFWgOpQ8DKGBoT4tL5e-SxVcsK6g,15068
aiomysql/sa/transaction.py,sha256=yo7wx499DNkrcyzM6cGCcPvKZmOhwAStX-kMQ0RdNbE,4912
aiomysql/utils.py,sha256=ZgJPntELXtlFez-gkzkNzYM4IeuKKthP5Qu2Bhf25T8,4486
docs/Makefile,sha256=i2WHuFlgfyAPEW4ssEP8NY4cOibDJrVjvzSEU8_Ggwc,634
docs/__pycache__/conf.cpython-311.pyc,,
docs/conf.py,sha256=5HixmcavnVZNs07gk59ulx2emtQOG5l8g3I8g8dJch4,1289
docs/connection.rst,sha256=8w1AYdedRYoXSj0Jf5X6OMFkBY7od3lN3lePid_x5wg,6862
docs/contributing.rst,sha256=_sP3g7FGhmVYXKyXXpTB7k-lutO2wDsgld6kPzPgQw4,61
docs/cursors.rst,sha256=aiePMqZZfXpyPz6M2rVslkEu8YagphSwAjR6mvdlA3A,14388
docs/examples.rst,sha256=NUxBFb6l0loKVhTQCMWCQgYso-SIU3_yDzkbaSF0eqw,948
docs/glossary.rst,sha256=RmPxRY0bhcYNHI-5KpZHxu71wVpgC1ALfiHNWLDgSdU,1354
docs/index.rst,sha256=KSSHE477YQqvfe7tdx-6DEVPQ_ivG4U0qQsdQiBsmuQ,3581
docs/make.bat,sha256=vKazJE8RW49Cy8K7hm8QYbletvAd8YkeKsaPA_dWnXs,800
docs/pool.rst,sha256=nXsUs1FWA8mm2yrI3e2GPyCa5IHDgmQHJhqH9UelEWM,4414
docs/sa.rst,sha256=paAc_fBgsYT50kuhaXd78JQiBNYwMGRe_CMELAfXKbg,19211
docs/tutorial.rst,sha256=OeGOl2j9vy15fBPCKqg4eDIZVXlOF6dstrpfmgH9S_Q,4977
examples/__pycache__/example.cpython-311.pyc,,
examples/__pycache__/example_callproc.cpython-311.pyc,,
examples/__pycache__/example_callproc_oldstyle.cpython-311.pyc,,
examples/__pycache__/example_cursors.cpython-311.pyc,,
examples/__pycache__/example_executemany.cpython-311.pyc,,
examples/__pycache__/example_executemany_oldstyle.cpython-311.pyc,,
examples/__pycache__/example_oldstyle.cpython-311.pyc,,
examples/__pycache__/example_pool.cpython-311.pyc,,
examples/__pycache__/example_pool_oldstyle.cpython-311.pyc,,
examples/__pycache__/example_simple_sa.cpython-311.pyc,,
examples/__pycache__/example_simple_sa_oldstyle.cpython-311.pyc,,
examples/__pycache__/example_ssl.cpython-311.pyc,,
examples/__pycache__/example_transaction.cpython-311.pyc,,
examples/__pycache__/example_transaction_oldstyle.cpython-311.pyc,,
examples/example.py,sha256=285ZBeRUxadbWZyPxOOK1uqceW_cmyngdds2OO3iTIk,513
examples/example_callproc.py,sha256=MwyutYbcoV6NTjHquOapZ2MPZ1ZXi5w2LZEj45nfjXk,747
examples/example_callproc_oldstyle.py,sha256=eycL8PVi4YE4oDERbszvLboorXzmECuIuPXyX6VZza4,812
examples/example_cursors.py,sha256=D5kQCzSJBRnTcy3kUTo8kNR8x1MJHH7xgIYQ_3hCUOQ,650
examples/example_executemany.py,sha256=-lSYumOSXBxsL6vsvGkXwXl9UvCJPXkOnZfZySue0TI,1502
examples/example_executemany_oldstyle.py,sha256=t8cve6KJX9QvYenec9zN0uALMfp8P_cxxBpIf_olwn4,1480
examples/example_oldstyle.py,sha256=jSpjYHzFD-X1R2Lcpn4AkzG6U1Erj1j2cwTrGmGpZUU,530
examples/example_pool.py,sha256=qtG6eX-0R-QGjtUkwXvrL4ra7TFmUgs7tu_ecbv48Ig,605
examples/example_pool_oldstyle.py,sha256=o47tzlq1Jwgzy5lFr50cz3z_Hi5IrZy5ctBVzTHnO9M,590
examples/example_simple_sa.py,sha256=BPEJ4q8SoCubbiwlD_fDD_QjWBbRjwPeGLRz7l0uf1o,1131
examples/example_simple_sa_oldstyle.py,sha256=jccHZ_Grt91kCgUyAMO31YmlonrYCI9exaPez5bbUWs,1220
examples/example_ssl.py,sha256=H1Ak6sSeZoNFMxR69S9rmegoZpduyUORrHMuDlTUE3A,1351
examples/example_transaction.py,sha256=o5k1p9mHm_OWyYFoVs7FXek7GvDPPjlN4q7RIH8IxfI,1777
examples/example_transaction_oldstyle.py,sha256=MdWlnBxH-TM3oKtLujfLrcC1Z4Aw7z0JHXrPbC7SMes,1732
@@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: setuptools (80.9.0)
Root-Is-Purelib: true
Tag: py3-none-any
@@ -0,0 +1,19 @@
Copyright (c) 2010, 2013 PyMySQL contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,3 @@
aiomysql
docs
examples