An asyncio PosgtreSQL driver
Project description
asyncpg is a database interface library designed specifically for PostgreSQL and Python/asyncio. asyncpg is an efficient, clean implementation of PostgreSQL server binary protocol for use with Python’s asyncio framework. You can read more about asyncpg in an introductory blog post.
asyncpg requires Python 3.5 or later and is supported for PostgreSQL versions 9.1 to 9.6.
Documentation
The project documentation can be found here.
Performance
In our testing asyncpg is, on average, 3x faster than psycopg2 (and its asyncio variant – aiopg).
The above results are a geometric mean of benchmarks obtained with PostgreSQL client driver benchmarking toolbench.
Features
asyncpg implements PostgreSQL server protocol natively and exposes its features directly, as opposed to hiding them behind a generic facade like DB-API.
This enables asyncpg to have easy-to-use support for:
prepared statements
scrollable cursors
partial iteration on query results
automatic encoding and decoding of composite types, arrays, and any combination of those
straightforward support for custom data types
Installation
asyncpg is available on PyPI and has no dependencies. Use pip to install:
$ pip install asyncpg
Basic Usage
import asyncio
import asyncpg
async def run():
conn = await asyncpg.connect(user='user', password='password',
database='database', host='127.0.0.1')
values = await conn.fetch('''SELECT * FROM mytable''')
await conn.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
License
asyncpg is developed and distributed under the Apache 2.0 license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asyncpg-0.10.1.tar.gz.
File metadata
- Download URL: asyncpg-0.10.1.tar.gz
- Upload date:
- Size: 439.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5b15bc1de8926d6cf4f800b434c8c101671e37a3e5acaae858670c9066c31a1
|
|
| MD5 |
66da3fee62ecfe0cd2fcc54fdee704da
|
|
| BLAKE2b-256 |
65ec73e7861d817d467c61e83555ac1796bdeb4800f1e68c89bd33ea6df8101f
|
File details
Details for the file asyncpg-0.10.1-cp36-cp36m-win_amd64.whl.
File metadata
- Download URL: asyncpg-0.10.1-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 651.0 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7be286ee39a55769bf63ec84a92b5ef8d361ea2a976c3baf14a179702171693
|
|
| MD5 |
f84aa7c566fbbd2ed280dd9c81c98e81
|
|
| BLAKE2b-256 |
df767ff53d423d3017c4ff5f43216eab8fb3cadc29e910be35169d24f69cc14e
|
File details
Details for the file asyncpg-0.10.1-cp36-cp36m-win32.whl.
File metadata
- Download URL: asyncpg-0.10.1-cp36-cp36m-win32.whl
- Upload date:
- Size: 612.2 kB
- Tags: CPython 3.6m, Windows x86
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e8dea4f5879122a8f487e46290d88c7d9a190f3c726afc11e36f2100889c139
|
|
| MD5 |
d8920dc973a161519792bd39cb6bba8f
|
|
| BLAKE2b-256 |
0f36ab2aea52ab72759465eca8f194bd3fb0635927ad7497adf8870a2c1b84ce
|
File details
Details for the file asyncpg-0.10.1-cp36-cp36m-manylinux1_x86_64.whl.
File metadata
- Download URL: asyncpg-0.10.1-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff955dd6d63ab58d41dfea155fed7fff43aa6eb41df48982050daf0388e24db0
|
|
| MD5 |
2e258a51253f426c125891400fbcc3d8
|
|
| BLAKE2b-256 |
52882dc00effbc724a341255b31ab6c91b7db3ef6f4dd6d68656b33742390850
|
File details
Details for the file asyncpg-0.10.1-cp36-cp36m-manylinux1_i686.whl.
File metadata
- Download URL: asyncpg-0.10.1-cp36-cp36m-manylinux1_i686.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a8266e2489d8124631737bd72e4f989a4f91e0172d018d3e1d91a9d9c2e06c7
|
|
| MD5 |
bebe93945ad9184d3139b49f04dae206
|
|
| BLAKE2b-256 |
d73f46ee877ca91312a182280b37e810c9690f75b802649edefab47d7526ef6a
|
File details
Details for the file asyncpg-0.10.1-cp36-cp36m-macosx_10_11_x86_64.whl.
File metadata
- Download URL: asyncpg-0.10.1-cp36-cp36m-macosx_10_11_x86_64.whl
- Upload date:
- Size: 747.3 kB
- Tags: CPython 3.6m, macOS 10.11+ x86-64
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4df42cfcc17c50a1c1cd5db101697ad8870653f33275f45b99caceab1b513838
|
|
| MD5 |
548c28d37c3434320bdc469312eb606f
|
|
| BLAKE2b-256 |
f1cfc285dea2ba8c9f96647c38d479f905b8bc5d183ef6c14e6607ac42ea897b
|
File details
Details for the file asyncpg-0.10.1-cp35-cp35m-win_amd64.whl.
File metadata
- Download URL: asyncpg-0.10.1-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 642.7 kB
- Tags: CPython 3.5m, Windows x86-64
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c123c365cae65d7952039d109a653817508810d032a15b5d1155db807e6f937f
|
|
| MD5 |
89037231b9fead78c26ff14957113c27
|
|
| BLAKE2b-256 |
db05c8c79026db2ad00e4408928d2e76748594d6157f9cdc99ee4fbc5151622f
|
File details
Details for the file asyncpg-0.10.1-cp35-cp35m-win32.whl.
File metadata
- Download URL: asyncpg-0.10.1-cp35-cp35m-win32.whl
- Upload date:
- Size: 606.2 kB
- Tags: CPython 3.5m, Windows x86
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec573f4605077e1d5be0a82404eb05af98b381ffbcd6ba873c24a11e92039e85
|
|
| MD5 |
37641d7cbaf972455dc4fdcf43dc924c
|
|
| BLAKE2b-256 |
415cf7e81c8decaa8cecbde05256eac18328a03c01601608134f7d2ff8357b42
|
File details
Details for the file asyncpg-0.10.1-cp35-cp35m-manylinux1_x86_64.whl.
File metadata
- Download URL: asyncpg-0.10.1-cp35-cp35m-manylinux1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.5m
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
669e2dfc5fd1e4d2f0c763d49b8b4099cb2c9f504169fe4fe604d55c0703b4da
|
|
| MD5 |
cc6d13550cfe3097f7d89b01c8575b2c
|
|
| BLAKE2b-256 |
f3c7d0c530bd86d7a48bec7e54f22bb93abe6881e86ffe30fbc9730bc30d089f
|
File details
Details for the file asyncpg-0.10.1-cp35-cp35m-manylinux1_i686.whl.
File metadata
- Download URL: asyncpg-0.10.1-cp35-cp35m-manylinux1_i686.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.5m
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1afbe00b80fab3d25bd73cd0364009e399a38bcc776a10fbf377ee44ca87f29
|
|
| MD5 |
df6accee806518b8a09656f9c9ea8905
|
|
| BLAKE2b-256 |
48334d74107cce2ec2bf6d7a157a9ab5485c05d4d65ce8add370cf3ce550f19e
|
File details
Details for the file asyncpg-0.10.1-cp35-cp35m-macosx_10_11_x86_64.whl.
File metadata
- Download URL: asyncpg-0.10.1-cp35-cp35m-macosx_10_11_x86_64.whl
- Upload date:
- Size: 737.6 kB
- Tags: CPython 3.5m, macOS 10.11+ x86-64
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e79049dc1253ff1c7a8f7ebad86205a8c08803795a57c7ba76276da3694f9409
|
|
| MD5 |
0cf43055263b2e9a9546aa045312c73a
|
|
| BLAKE2b-256 |
503c03028953cd76696a8a2e3d407d2fe82989518a45bcdd28f33ece0c083e10
|