Welcome to pg-purepy’s documentation!
pg-purepy is a Python 3.11+ library for connecting to a PostgreSQL server. As the name suggests,
it is written in pure-Python (no C dependencies), and exports three APIs:
A high-level asynchronous AnyIO API based on connection pooling, that wraps multiple individual persistent connections.
An mid-level asynchronous anyio API, based on singular connections, that handles the protocol parsing and networking for you.
A low-level sans-IO API, which only does protocol parsing and has no niceness but is ideal for writing your own client.
pg-purepyrequires at least Python 3.11.
pg-purepyrequires the latest version of PostgreSQL, although in practice the protocol parser should work with versions from 9.4 upwards.
- Current Support For PostgreSQL Features
- Message Types
- Base Classes
- State-related messages
- Auth-related messages
- Query-related messages
- Low-Level API
- Asynchronous connection API
- Querying, Eagerly
- Querying, Lazily
- Paramaterised Queries
- Low-level querying
- Error handling
- Transaction Helpers
- High-level API
- Converting Arguments and Results