aio-libs/aiopg
aio-libs/aiopg has 1,433 GitHub stars and 172 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-06 08:18 UTC. Last push 2026-10-26.
aiopg is a library for accessing a PostgreSQL database from the asyncio
Measured star growth
- in 24h
- 0
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalaiopg
.. image:: https://github.com/aio-libs/aiopg/workflows/CI/badge.svg :target: https://github.com/aio-libs/aiopg/actions?query=workflow%3ACI .. image:: https://codecov.io/gh/aio-libs/aiopg/branch/master/graph/badge.svg :target: https://codecov.io/gh/aio-libs/aiopg .. image:: https://badges.gitter.im/Join%20Chat.svg :target: https://gitter.im/aio-libs/Lobby :alt: Chat on Gitter
aiopg is a library for accessing a PostgreSQL_ database from the asyncio_ (PEP-3156/tulip) framework. It wraps asynchronous features of the Psycopg database driver.
Example
.. code:: python
import asyncio
import aiopg
dsn = 'dbname=aiopg user=aiopg password=passwd host=127.0.0.1'
async def go():
pool = await aiopg.create_pool(dsn)
async with pool.acquire() as conn:
async with conn.cursor() as cur:
await cur.execute("SELECT 1")
ret = []
async for row in cur:
ret.append(row)
assert ret == [(1,)]
loop = asyncio.get_event_loop()
loop.run_until_complete(go())
Example of SQLAlchemy optional integration
.. code:: python
import asyncio from aiopg.sa import create_engine import sqlalchemy as sa
metadata = sa.MetaData()
tbl = sa.Table('tbl', metadata, sa.Column('id', sa.Integer, primary_key=True), sa.Column('val', sa.String(255)))
async def create_table(engine): async with engine.acquire() as conn: await conn.execute('DROP TABLE IF EXISTS tbl') await conn.execute('''CREATE TABLE tbl ( id serial PRIMARY KEY, val varchar(255))''')
async def go(): async with create_engine(user='aiopg', database='aiopg', host='127.0.0.1', password='passwd') as engine:
async with engine.acquire() as conn:
await conn.execute(tbl.insert().values(val='abc'))
async for row in conn.execute(tbl.select()):
print(row.id, row.val)
loop = asyncio.get_event_loop() loop.run_until_complete(go())
.. _PostgreSQL: http://www.postgresql.org/ .. _asyncio: https://docs.python.org/3/library/asyncio.html
Please use::
$ make test
for executing the project's unittests. See https://aiopg.readthedocs.io/en/stable/contributing.html for details on how to set up your environment to run the tests.
Explore related projects
Asabeneh/30-Days-Of-Python
The 30 Days of Python programming challenge is a step-by-step guide to learn the Python programming language in 30 days. This challenge may take more than 100 days. Follow your own pace. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,236 starsgrafana/grafana
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
77,725 starsredis/redis
For developers, who are building real-time data-driven applications, Redis is the preferred, fastest, and most feature-rich cache, data structure server, and document and vector query engine.
77,201 starsapache/superset
Apache Superset is a Data Visualization and Data Exploration Platform
75,439 stars