{"id":21063,"library":"connection-pool","title":"Connection Pool","description":"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.","status":"maintenance","version":"0.0.3","language":"python","source_language":"en","source_url":"https://github.com/zhouyl/ConnectionPool","tags":["connection-pool","thread-safe","concurrency"],"install":[{"cmd":"pip install connection-pool","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"Pool","correct":"from connection_pool import ConnectionPool"}],"quickstart":{"code":"from connection_pool import ConnectionPool\n\n# Create a pool with a factory function for connections\npool = ConnectionPool(\n    max_size=5,\n    create=lambda: {'conn': 'example'},\n    close=lambda conn: None\n)\n\n# Acquire a connection\nwith pool.acquire() as conn:\n    # Use the connection\n    print(conn)\n    pass\n\n# Connections are returned automatically","lang":"python","description":"Basic usage of ConnectionPool with context manager."},"warnings":[{"fix":"Implement your own validation before returning connections to the pool.","message":"The library does not support connection validation or health checks. If a connection is broken after acquisition, the pool does not detect it.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using more robust pools like SQLAlchemy's or redis-py's connection pool for production.","message":"The library uses a simple list-based queue which may not be suitable for high-concurrency scenarios. Performance may degrade under heavy load.","severity":"gotcha","affected_versions":"all"},{"fix":"Always specify a timeout when acquiring connections: `pool.acquire(timeout=5)`.","message":"The `acquire()` method will block indefinitely if the pool is exhausted and no timeout is set. This can cause deadlocks.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.0.3':26 '2025':34 'appear':37 'client':24 'concurr':53 'connect':1,8,19,48 'connection-pool':47 'databas':21 'e.g':20 'earli':33 'generic':14 'http':23 'latest':29 'mainten':41 'minim':4 'mode':42 'pool':2,9,15,49 'project':36 'provid':12 'python':11 'recent':45 'releas':30 'reusabl':18 'safe':7,52 'socket':22 'thread':6,51 'thread-saf':5,50 'updat':46 'version':25","created_at":"2026-04-27T16:57:53.259827+00:00","updated_at":"2026-04-27T16:57:53.259827+00:00","problems":[{"fix":"Install with `pip install connection-pool` and import as `from connection_pool import ConnectionPool`.","cause":"Using wrong import path (hyphen instead of underscore). The package slug is 'connection-pool' but import uses underscore.","error":"ModuleNotFoundError: No module named 'connection_pool'"},{"fix":"Use `pool.acquire()` to obtain a connection.","cause":"Attempting to use a method that does not exist. The correct API is `pool.acquire()`","error":"connection_pool.ConnectionPool object has no attribute 'get_connection'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.0.3","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/zhouyl/ConnectionPool","docs":null,"changelog":null,"pypi":"https://pypi.org/project/connection-pool/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}