{"id":13482109,"url":"https://github.com/05bit/peewee-async","last_synced_at":"2026-01-10T20:58:09.029Z","repository":{"id":21228784,"uuid":"24544015","full_name":"05bit/peewee-async","owner":"05bit","description":"Asynchronous interface for peewee ORM powered by asyncio","archived":false,"fork":false,"pushed_at":"2025-02-08T06:46:39.000Z","size":533,"stargazers_count":739,"open_issues_count":22,"forks_count":98,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-02-08T07:26:39.849Z","etag":null,"topics":["asyncio","mysql","orm","peewee","postgresql","python"],"latest_commit_sha":null,"homepage":"http://peewee-async-lib.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/05bit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-27T22:15:28.000Z","updated_at":"2025-02-08T06:46:43.000Z","dependencies_parsed_at":"2023-02-11T14:01:14.782Z","dependency_job_id":"bddb74f4-3fad-4471-8c7f-0a5171d761a1","html_url":"https://github.com/05bit/peewee-async","commit_stats":{"total_commits":240,"total_committers":28,"mean_commits":8.571428571428571,"dds":"0.23750000000000004","last_synced_commit":"e9f85e84a61954f5f2951afb13525dd96832ac59"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/05bit%2Fpeewee-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/05bit%2Fpeewee-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/05bit%2Fpeewee-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/05bit%2Fpeewee-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/05bit","download_url":"https://codeload.github.com/05bit/peewee-async/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245845217,"owners_count":20681867,"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":["asyncio","mysql","orm","peewee","postgresql","python"],"created_at":"2024-07-31T17:00:59.053Z","updated_at":"2025-03-27T12:32:10.658Z","avatar_url":"https://github.com/05bit.png","language":"Python","readme":"peewee-async\n============\n\nAsynchronous interface for **[peewee](https://github.com/coleifer/peewee)**\nORM powered by **[asyncio](https://docs.python.org/3/library/asyncio.html)**.\n\n[![CI workflow](https://github.com/05bit/peewee-async/actions/workflows/tests.yml/badge.svg)](https://github.com/05bit/peewee-async/actions/workflows/tests.yml) [![PyPi Version](https://img.shields.io/pypi/v/peewee-async.svg)](https://pypi.python.org/pypi/peewee-async)\n [![Documentation Status](https://readthedocs.org/projects/peewee-async-lib/badge/?version=latest)](https://peewee-async-lib.readthedocs.io/en/latest/?badge=latest)\n\n\nOverview\n--------\n\n* Requires Python 3.9+\n* Has support for PostgreSQL via [aiopg](https://github.com/aio-libs/aiopg)\n* Has support for MySQL via [aiomysql](https://github.com/aio-libs/aiomysql)\n* Asynchronous analogues of peewee sync methods with prefix aio_\n* Drop-in replacement for sync code, sync will remain sync\n* Basic operations are supported\n* Transactions support is present\n\nThe complete documentation:  \nhttp://peewee-async-lib.readthedocs.io\n\n\nInstall\n-------\n\nInstall with `pip` for PostgreSQL aiopg backend:\n\n```bash\npip install peewee-async[postgresql]\n```\n\nor for PostgreSQL psycopg3 backend:\n\n```bash\npip install peewee-async[psycopg]\n```\n\nor for MySQL:\n\n```bash\npip install peewee-async[mysql]\n```\n\n\nQuickstart\n----------\n\nCreate 'test' PostgreSQL database for running this snippet:\n\n    createdb -E utf-8 test\n\n```python\nimport asyncio\nimport peewee\nimport peewee_async\n\n# Nothing special, just define model and database:\n\ndatabase = peewee_async.PooledPostgresqlDatabase(\n    database='db_name',\n    user='user',\n    host='127.0.0.1',\n    port='5432',\n    password='password',\n)\n\nclass TestModel(peewee_async.AioModel):\n    text = peewee.CharField()\n\n    class Meta:\n        database = database\n\n# Look, sync code is working!\n\nTestModel.create_table(True)\nTestModel.create(text=\"Yo, I can do it sync!\")\ndatabase.close()\n\n# No need for sync anymore!\n\ndatabase.set_allow_sync(False)\n\nasync def handler():\n    await TestModel.aio_create(text=\"Not bad. Watch this, I'm async!\")\n    all_objects = await TestModel.select().aio_execute()\n    for obj in all_objects:\n        print(obj.text)\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(handler())\nloop.close()\n\n# Clean up, can do it sync again:\nwith database.allow_sync():\n    TestModel.drop_table(True)\n\n# Expected output:\n# Yo, I can do it sync!\n# Not bad. Watch this, I'm async!\n```\n\n\nMore examples\n-------------\n\nCheck the .`/examples` directory for more.\n\n\nDocumentation\n-------------\n\nhttp://peewee-async-lib.readthedocs.io\n\nhttp://peewee-async.readthedocs.io - **DEPRECATED**\n\n\nDeveloping\n----------\n\nInstall dependencies using pip:\n\n```bash\npip install -e .[develop]\n```\n\nOr using [poetry](https://python-poetry.org/docs/):\n\n```bash\npoetry install -E develop\n```\n\nRun databases:\n\n```bash\ndocker-compose up -d\n```\n\nRun tests:\n\n```bash\npytest tests -v -s\n```\n\n\nDiscuss\n-------\n\nYou are welcome to add discussion topics or bug reports to tracker on GitHub: https://github.com/05bit/peewee-async/issues\n\nLicense\n-------\n\nCopyright (c) 2014, Alexey Kinev \u003crudy@05bit.com\u003e\n\nLicensed under The MIT License (MIT),\nsee LICENSE file for more details.\n","funding_links":[],"categories":["数据库驱动","Python","Database Drivers"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F05bit%2Fpeewee-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F05bit%2Fpeewee-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F05bit%2Fpeewee-async/lists"}