Registry / database / connection-pool

connection-pool

JSON →
library0.0.3pypypi✓ verified 90d ago

A minimal thread-safe connection pool for Python, providing a generic pool for any reusable connections (e.g., database sockets, HTTP clients). Version 0.0.3 is the latest release as of early 2025; the project appears to be in maintenance mode with no recent updates.

pip install connection-pool
INSTALL
IMPORT
SIG · CONNECTION-POOL
C
connection-pool
databasepythonv0.0.3
Install
2.4s avg
Import
10ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.004s · 19.2MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 2.4s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Pool
✓ from connection_pool import ConnectionPool

Basic usage of ConnectionPool with context manager.

from connection_pool import ConnectionPool # Create a pool with a factory function for connections pool = ConnectionPool( max_size=5, create=lambda: {'conn': 'example'}, close=lambda conn: None ) # Acquire a connection with pool.acquire() as conn: # Use the connection print(conn) pass # Connections are returned automatically
Debug
Known issues
gotchaThe library does not support connection validation or health checks. If a connection is broken after acquisition, the pool does not detect it.
fix
Implement your own validation before returning connections to the pool.
affects: all
gotchaThe library uses a simple list-based queue which may not be suitable for high-concurrency scenarios. Performance may degrade under heavy load.
fix
Consider using more robust pools like SQLAlchemy's or redis-py's connection pool for production.
affects: all
gotchaThe `acquire()` method will block indefinitely if the pool is exhausted and no timeout is set. This can cause deadlocks.
fix
Always specify a timeout when acquiring connections: `pool.acquire(timeout=5)`.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'connection_pool'
Using wrong import path (hyphen instead of underscore). The package slug is 'connection-pool' but import uses underscore.
fix
Install with `pip install connection-pool` and import as `from connection_pool import ConnectionPool`.
connection_pool.ConnectionPool object has no attribute 'get_connection'
Attempting to use a method that does not exist. The correct API is `pool.acquire()`
fix
Use `pool.acquire()` to obtain a connection.
Upgrade
Version history
0.0.3latest on PyPI · released Sep 17, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources
connection-pool — pip install connection-pool · libregistry