{"id":13462564,"url":"https://github.com/PyMySQL/PyMySQL","last_synced_at":"2025-03-25T01:32:17.117Z","repository":{"id":40589214,"uuid":"2114213","full_name":"PyMySQL/PyMySQL","owner":"PyMySQL","description":"MySQL client library for Python","archived":false,"fork":false,"pushed_at":"2025-01-29T09:06:45.000Z","size":1443,"stargazers_count":7734,"open_issues_count":18,"forks_count":1432,"subscribers_count":224,"default_branch":"main","last_synced_at":"2025-03-20T20:35:51.581Z","etag":null,"topics":["mysql","python"],"latest_commit_sha":null,"homepage":"https://pymysql.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PyMySQL.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["methane"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":"pypi/PyMySQL","community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2011-07-27T17:38:47.000Z","updated_at":"2025-03-20T14:33:53.000Z","dependencies_parsed_at":"2023-02-10T20:15:42.451Z","dependency_job_id":"3f4f2220-a3f4-4a43-8e5c-d68870b15e0c","html_url":"https://github.com/PyMySQL/PyMySQL","commit_stats":{"total_commits":939,"total_committers":136,"mean_commits":6.904411764705882,"dds":0.6421725239616614,"last_synced_commit":"a1ac8239c8bf79e7f1a17347b10d6e184221f9c1"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyMySQL%2FPyMySQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyMySQL%2FPyMySQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyMySQL%2FPyMySQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyMySQL%2FPyMySQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PyMySQL","download_url":"https://codeload.github.com/PyMySQL/PyMySQL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245377920,"owners_count":20605374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mysql","python"],"created_at":"2024-07-31T12:00:52.140Z","updated_at":"2025-03-25T01:32:17.111Z","avatar_url":"https://github.com/PyMySQL.png","language":"Python","readme":"[![Documentation Status](https://readthedocs.org/projects/pymysql/badge/?version=latest)](https://pymysql.readthedocs.io/)\n[![codecov](https://codecov.io/gh/PyMySQL/PyMySQL/branch/main/graph/badge.svg?token=ppEuaNXBW4)](https://codecov.io/gh/PyMySQL/PyMySQL)\n\n# PyMySQL\n\nThis package contains a pure-Python MySQL and MariaDB client library, based on\n[PEP 249](https://www.python.org/dev/peps/pep-0249/).\n\n## Requirements\n\n- Python -- one of the following:\n  - [CPython](https://www.python.org/) : 3.7 and newer\n  - [PyPy](https://pypy.org/) : Latest 3.x version\n- MySQL Server -- one of the following:\n  - [MySQL](https://www.mysql.com/) \\\u003e= 5.7\n  - [MariaDB](https://mariadb.org/) \\\u003e= 10.4\n\n## Installation\n\nPackage is uploaded on [PyPI](https://pypi.org/project/PyMySQL).\n\nYou can install it with pip:\n\n    $ python3 -m pip install PyMySQL\n\nTo use \"sha256_password\" or \"caching_sha2_password\" for authenticate,\nyou need to install additional dependency:\n\n    $ python3 -m pip install PyMySQL[rsa]\n\nTo use MariaDB's \"ed25519\" authentication method, you need to install\nadditional dependency:\n\n    $ python3 -m pip install PyMySQL[ed25519]\n\n## Documentation\n\nDocumentation is available online: \u003chttps://pymysql.readthedocs.io/\u003e\n\nFor support, please refer to the\n[StackOverflow](https://stackoverflow.com/questions/tagged/pymysql).\n\n## Example\n\nThe following examples make use of a simple table\n\n``` sql\nCREATE 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=utf8mb4 COLLATE=utf8mb4_bin\nAUTO_INCREMENT=1 ;\n```\n\n``` python\nimport pymysql.cursors\n\n# Connect to the database\nconnection = pymysql.connect(host='localhost',\n                             user='user',\n                             password='passwd',\n                             database='db',\n                             cursorclass=pymysql.cursors.DictCursor)\n\nwith connection:\n    with connection.cursor() as cursor:\n        # Create a new record\n        sql = \"INSERT INTO `users` (`email`, `password`) VALUES (%s, %s)\"\n        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    connection.commit()\n\n    with connection.cursor() as cursor:\n        # Read a single record\n        sql = \"SELECT `id`, `password` FROM `users` WHERE `email`=%s\"\n        cursor.execute(sql, ('webmaster@python.org',))\n        result = cursor.fetchone()\n        print(result)\n```\n\nThis example will print:\n\n``` python\n{'password': 'very-secret', 'id': 1}\n```\n\n## Resources\n\n- DB-API 2.0: \u003chttps://www.python.org/dev/peps/pep-0249/\u003e\n- MySQL Reference Manuals: \u003chttps://dev.mysql.com/doc/\u003e\n- Getting Help With MariaDB \u003chttps://mariadb.com/kb/en/getting-help-with-mariadb/\u003e\n- MySQL client/server protocol:\n  \u003chttps://dev.mysql.com/doc/internals/en/client-server-protocol.html\u003e\n- \"Connector\" channel in MySQL Community Slack:\n  \u003chttps://lefred.be/mysql-community-on-slack/\u003e\n- PyMySQL mailing list:\n  \u003chttps://groups.google.com/forum/#!forum/pymysql-users\u003e\n\n## License\n\nPyMySQL is released under the MIT License. See LICENSE for more\ninformation.\n","funding_links":["https://github.com/sponsors/methane","https://tidelift.com/funding/github/pypi/PyMySQL"],"categories":["Database Drivers","Python","Uncategorized","资源列表","Database","数据库 Drivers","Data Management \u0026 Processing","数据库驱动程序","Python (1887)","🗃️ SQL \u0026 Databases","Database Clients","Database Drivers [🔝](#readme)","Awesome Python","Awesome common libraries","Connectors"],"sub_categories":["Uncategorized","数据库驱动","Database Drivers","Database \u0026 Cloud Management","Tools","Automatic Plotting","ASGI Servers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPyMySQL%2FPyMySQL","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPyMySQL%2FPyMySQL","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPyMySQL%2FPyMySQL/lists"}