One config file, every PostgreSQL connection type. Sync, async, pooled, and async-pooled — all from a single YAML.
Write your connection settings once. Choose the connection type at call time — or let the config default handle it.
from pgmonkey import PGConnectionManager
manager = PGConnectionManager()
# Same config file, different connection types
conn = manager.get_database_connection('config.yaml', 'normal')
conn = manager.get_database_connection('config.yaml', 'pool')
conn = await manager.get_database_connection('config.yaml', 'async')
conn = await manager.get_database_connection('config.yaml', 'async_pool')
Define connection settings, pool sizes, async timeouts, and SSL in a single YAML file. No more juggling separate configs per connection type.
Built-in sync and async connection pooling via psycopg_pool. Configure pool sizes, idle timeouts, and max lifetimes.
First-class async connections and async pooling powered by psycopg3. Async settings are applied via SQL SET commands automatically.
Full support for SSL modes from disable to verify-full, plus client certificate authentication for enterprise environments.
Create config templates, test connections, generate Python code, and get server config recommendations — all from the command line.
Bulk import CSV data into PostgreSQL tables and export query results to CSV, with auto-generated config templates for column mapping.
Up and running in three steps.
pip install pgmonkey
pgmonkey pgconfig create --type pg --filepath config.yaml
Edit the generated YAML with your database credentials.
pgmonkey pgconfig test --connconfig config.yaml --connection-type normal
Try pool, async, or async_pool to test other types.
pgmonkey works with a wide range of Python and dependency versions.
psycopg3 with binary support
Sync & async pooling
YAML configuration parsing