psycogreen
psycopg2 integration with coroutine libraries
Decision gist · record as of 2026-08-14
Yes, if you are already committed to gevent or eventlet and need psycopg2 to cooperate with that event loop. No, if you are starting a new project—modern alternatives like asyncpg or psycopg3 with native async support are better choices. Caution: dormant maintenance (last release 2020) and source-only distribution mean you accept integration risk and potential compatibility issues with recent Python or psycopg2 versions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires psycopg2 to be installed separately.
- Requires either gevent or eventlet to be installed and active in your application.
- High install friction: source distribution only (psycogreen-1.0.2.tar.gz).
License · maintenance · safety
BSD (permissive) — BSD license (permissive). No restrictions on commercial or private use; you may modify and redistribute under the same license terms.
last release 2020-02-22 (2365 days) · last repo commit 2023-12-04 · 108 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,025,661 downloads/mo, #4,480 on PyPI
Alternatives
Verify before relying
pip install psycogreen
import psycogreen.gevent
psycogreen.gevent.patch_psycopg()
# or
import psycogreen.eventlet
psycogreen.eventlet.patch_psycopg()- Compatibility with modern psycopg2 versions (package has not been released since 2020)
- Whether gevent or eventlet monkey-patching approach is still the recommended pattern for async PostgreSQL in modern Python
- Python 3.10+ support status (classifiers list Python 2 and 3 generically)
What it is and what it does
psycogreen provides wait callbacks that hook psycopg2 into coroutine event loops, enabling non-blocking database queries within gevent and eventlet applications. It works by registering callbacks with psycopg2's extension API so that when a database operation would block, control returns to the event loop instead of freezing the thread.
The package offers two main modules: psycogreen.gevent for gevent integration and psycogreen.eventlet for eventlet integration. Each exposes a patch_psycopg() function and a corresponding wait callback. It is designed for applications that already use gevent or eventlet for concurrency and need their PostgreSQL queries to cooperate with that event loop rather than blocking.
Use it for
- Run concurrent PostgreSQL queries in a gevent-based web application without blocking other greenlets.
- Integrate psycopg2 into an eventlet application that needs non-blocking database access alongside other async I/O.
- Avoid Eventlet's default monkeypatching by explicitly registering psycogreen's wait callback for finer control.
- Enable uWSGI green thread applications to execute asynchronous database operations within the async platform.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are already committed to gevent or eventlet and need psycopg2 to cooperate with that event loop.
No, if you are starting a new project—modern alternatives like asyncpg or psycopg3 with native async support are better choices. Caution: dormant maintenance (last release 2020) and source-only distribution mean you accept integration risk and potential compatibility issues with recent Python or psycopg2 versions.
Install
psycogreen on PyPI
Before you install
High install friction: source distribution only (psycogreen-1.0.2.tar.gz). Dormant maintenance—last release 2020-02-22, last commit 2023-12-04, no recent activity. Not actively maintained but repository remains open.
Requires psycopg2 to be installed separately. Requires either gevent or eventlet to be installed and active in your application.
License in practice
BSD license (permissive). No restrictions on commercial or private use; you may modify and redistribute under the same license terms.
Quickstart
pip install psycogreen
import psycogreen.gevent
psycogreen.gevent.patch_psycopg()
# or
import psycogreen.eventlet
psycogreen.eventlet.patch_psycopg()
Verify before relying
- Compatibility with modern psycopg2 versions (package has not been released since 2020)
- Whether gevent or eventlet monkey-patching approach is still the recommended pattern for async PostgreSQL in modern Python
- Python 3.10+ support status (classifiers list Python 2 and 3 generically)
Package facts
| License | BSD permissive |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Dormant 2,365 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,025,661 / month, #4,480 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Database |
Evidence: psycogreen-1.0.2.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “psycopg2 async coroutine integration”
- psycogreenIntegrates psycopg2 with coroutine libraries (eventlet, gevent) by…
- aioprocessingProvides asyncio-compatible wrappers around multiprocessing objects…
- aiopgaiopg provides asyncio-based access to PostgreSQL databases, wrapping…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also django-db-geventpool · gevent · eventlet · greenlet · psycopg · aws-psycopg2 · psycopg2 · aiopg · asynckivy