{"id":15650178,"url":"https://github.com/phenobarbital/asyncdb","last_synced_at":"2026-04-01T19:06:15.157Z","repository":{"id":43396374,"uuid":"293566206","full_name":"phenobarbital/asyncdb","owner":"phenobarbital","description":"Collection of Asynchronous (Asyncio-based) generic Database connectors","archived":false,"fork":false,"pushed_at":"2026-03-20T02:50:10.000Z","size":286042,"stargazers_count":54,"open_issues_count":17,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-20T15:56:28.890Z","etag":null,"topics":["aioinflux","asyncio","asyncio-redis","asyncmy","asyncpg","cassandra","duckdb","hazelcast","mysql","rethinkdb"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phenobarbital.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-09-07T15:32:37.000Z","updated_at":"2026-03-20T02:49:16.000Z","dependencies_parsed_at":"2022-09-09T17:31:13.485Z","dependency_job_id":"fd1cbe7b-9920-47b2-a078-89785caa6698","html_url":"https://github.com/phenobarbital/asyncdb","commit_stats":{"total_commits":1160,"total_committers":13,"mean_commits":89.23076923076923,"dds":"0.21896551724137936","last_synced_commit":"f747329f5374372950c7dec1589525d23651fe29"},"previous_names":[],"tags_count":196,"template":false,"template_full_name":null,"purl":"pkg:github/phenobarbital/asyncdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenobarbital%2Fasyncdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenobarbital%2Fasyncdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenobarbital%2Fasyncdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenobarbital%2Fasyncdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phenobarbital","download_url":"https://codeload.github.com/phenobarbital/asyncdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenobarbital%2Fasyncdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aioinflux","asyncio","asyncio-redis","asyncmy","asyncpg","cassandra","duckdb","hazelcast","mysql","rethinkdb"],"created_at":"2024-10-03T12:33:45.981Z","updated_at":"2026-04-01T19:06:15.146Z","avatar_url":"https://github.com/phenobarbital.png","language":"Python","readme":"# AsyncDB #\n\nAsyncDB is a collection of different Database Drivers using asyncio-based connections and binary connectors (as asyncpg) but providing an abstraction layer to easily connect to different data sources, a high-level abstraction layer for various non-blocking database connectors,\non other blocking connectors (like MS SQL Server) we are using ThreadPoolExecutors to run in a non-blocking manner.\n\n### Why AsyncDB? ###\n\nThe finality of AsyncDB is to provide us with a subset of drivers (connectors) for accessing different databases and data sources for data interaction.\nThe main goal of AsyncDB is to use asyncio-based technologies.\n\n### Getting Started ###\n\n## Requirements\n\nPython 3.9+\n\n## Installation\n\n\u003cdiv class=\"termy\"\u003e\n\n```console\n$ pip install asyncdb\n---\u003e 100%\nSuccessfully installed asyncdb\n```\n\nCan also install only drivers required like:\n```console\n$ pip install asyncdb[pg] # this install only asyncpg\n```\nOr install all supported drivers as:\n\n```console\n$ pip install asyncdb[all]\n```\n\n### Requirements ###\n\n* Python \u003e= 3.8\n* asyncio (https://pypi.python.org/pypi/asyncio/)\n\nCurrently AsyncDB supports the following databases:\n\n* PostgreSQL (supporting two different connectors: asyncpg or aiopg)\n* SQLite (requires aiosqlite)\n* mySQL/MariaDB (requires aiomysql and mysqlclient)\n* ODBC (using aioodbc)\n* JDBC(using JayDeBeApi and JPype)\n* RethinkDB (requires rethinkdb)\n* Redis (requires aioredis)\n* Memcache (requires aiomcache)\n* MS SQL Server (non-asyncio using freeTDS and pymssql)\n* Apache Cassandra (requires official cassandra driver)\n* InfluxDB (using influxdb)\n* CouchBase (using aiocouch)\n* MongoDB (using motor and pymongo)\n* SQLAlchemy (requires sqlalchemy async (+3.14))\n* Oracle (requires oracledb)\n* Redpanda (Kafka-compatible, requires aiokafka)\n\n### Quick Tutorial ###\n\n```python\nfrom asyncdb import AsyncDB\n\ndb = AsyncDB('pg', dsn='postgres://user:password@localhost:5432/database')\n\n# Or you can also passing a dictionary with parameters like:\nparams = {\n    \"user\": \"user\",\n    \"password\": \"password\",\n    \"host\": \"localhost\",\n    \"port\": \"5432\",\n    \"database\": \"database\",\n    \"DEBUG\": True,\n}\ndb = AsyncDB('pg', params=params)\n\nasync with await db.connection() as conn:\n    result, error = await conn.query('SELECT * FROM test')\n```\nAnd that's it!, we are using the same methods on all drivers, maintaining a consistent interface between all of them, facilitating the re-use of the same code for different databases.\n\nEvery Driver has a simple name to call it:\n* pg: AsyncPG (PostgreSQL)\n* postgres: aiopg (PostgreSQL)\n* mysql: aiomysql (mySQL)\n* influx: influxdb (InfluxDB)\n* redis: redis-py (Redis)\n* mcache: aiomcache (Memcache)\n* odbc: aiodbc (ODBC)\n* oracle: oracle (oracledb)\n* redpanda: Redpanda/Kafka (aiokafka)\n\n### Output Support ###\n\nWith Output Support results can be returned into a wide-range of variants:\n\n```python\nfrom datamodel import BaseModel\n\nclass Point(BaseModel):\n    col1: list\n    col2: list\n    col3: list\n\ndb = AsyncDB('pg', dsn='postgres://user:password@localhost:5432/database')\nasync with await d.connection() as conn:\n    # changing output format to Pandas:\n    conn.output_format('pandas')  # change output format to pandas\n    result, error = await conn.query('SELECT * FROM test')\n    conn.output_format('csv')  # change output format to CSV\n    result, _ = await conn.query('SELECT TEST')\n    conn.output_format('dataclass', model=Point)  # change output format to Dataclass Model\n    result, _ = await conn.query('SELECT * FROM test')\n```\n\nCurrently AsyncDB supports the following Output Formats:\n\n* CSV (comma-separated or parametrized)\n* JSON (using orjson)\n* iterable (returns a generator)\n* Recordset (Internal meta-Object for list of Records)\n* Pandas (a pandas Dataframe)\n* Datatable (Dt Dataframe)\n* Dataclass (exporting data to a dataclass with -optionally- passing Dataclass instance)\n* PySpark Dataframe\n\nAnd others to come:\n* Apache Arrow (using pyarrow)\n* Polars (Using Python polars)\n* Dask Dataframe\n\n### Contribution guidelines ###\n\nPlease have a look at the Contribution Guide\n\n* Writing tests\n* Code review\n\n### Who do I talk to? ###\n\n* Repo owner or admin\n* Other community or team contact\n\n### License ###\n\nAsyncDB is copyright of Jesus Lara (https://phenobarbital.info) and is licensed under BSD. I am providing code in this repository under an open source licenses, remember, this is my personal repository; the license that you receive is from me and not from my employeer.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphenobarbital%2Fasyncdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphenobarbital%2Fasyncdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphenobarbital%2Fasyncdb/lists"}