{"id":24443,"library":"python-bitcoinrpc","title":"python-bitcoinrpc","description":"Enhanced version of python-jsonrpc for use with Bitcoin. This library provides a simple RPC client to interact with Bitcoin Core's JSON-RPC API. Current version is 1.0, but the project is in maintenance mode and has known issues with modern Python and Bitcoin Core versions.","status":"maintenance","version":"1.0","language":"python","source_language":"en","source_url":"http://www.github.com/jgarzik/python-bitcoinrpc","tags":["bitcoin","rpc","json-rpc","blockchain"],"install":[{"cmd":"pip install python-bitcoinrpc","lang":"bash","label":"pip install"}],"dependencies":[],"imports":[{"note":"import from bitcoinrpc.authproxy directly, not from bitcoinrpc top-level","wrong":"from bitcoinrpc import AuthServiceProxy","symbol":"AuthServiceProxy","correct":"from bitcoinrpc.authproxy import AuthServiceProxy"},{"note":"JSONRPCException is defined in authproxy module, not in exceptions","wrong":"from bitcoinrpc.exceptions import JSONRPCException","symbol":"JSONRPCException","correct":"from bitcoinrpc.authproxy import JSONRPCException"}],"quickstart":{"code":"from bitcoinrpc.authproxy import AuthServiceProxy\n\nrpc_user = os.environ.get('RPC_USER', 'user')\nrpc_password = os.environ.get('RPC_PASSWORD', 'pass')\nrpc_host = os.environ.get('RPC_HOST', '127.0.0.1')\nrpc_port = os.environ.get('RPC_PORT', '8332')\n\n# Note: python-bitcoinrpc expects URL with credentials embedded\nurl = f'http://{rpc_user}:{rpc_password}@{rpc_host}:{rpc_port}'\nproxy = AuthServiceProxy(url)\n\n# Test connection\nprint(proxy.getblockchaininfo())","lang":"python","description":"Connect to a Bitcoin Core RPC server using environment variables for credentials."},"warnings":[{"fix":"Construct the URL as 'http://{rpc_user}:{rpc_password}@{rpc_host}:{rpc_port}'","message":"The library expects the RPC URL to contain the username and password directly in the URL (e.g., http://user:pass@host:port). Using a pre-authenticated URL or passing separate credentials to AuthServiceProxy is not supported.","severity":"breaking","affected_versions":"all"},{"fix":"Switch to the maintained fork 'python-bitcoinrpc' (different package) or use requests library directly.","message":"python-bitcoinrpc is largely unmaintained and does not support Python 3.7+. It uses deprecated 'cookielib' and other Python 2 idioms. Consider using 'bitcoinrpc' (Python 3 fork) or direct requests to call JSON-RPC.","severity":"deprecated","affected_versions":">=1.0"},{"fix":"Ensure RPC server is on localhost or use a reverse proxy with HTTPS.","message":"The library does not support SSL/TLS by default. Connecting over plain HTTP may expose credentials. Use a local RPC connection or tunnel if needed.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install python-bitcoinrpc' and verify import path: from bitcoinrpc.authproxy import AuthServiceProxy","cause":"The package is not installed or installed in wrong environment.","error":"ImportError: No module named bitcoinrpc.authproxy"},{"fix":"Ensure the RPC server returns valid JSON. Check that the URL is correct and the server is running.","cause":"The library's regex parsing of the RPC response failed, often due to malformed response or unexpected characters.","error":"AttributeError: 'NoneType' object has no attribute 'group'"},{"fix":"Verify RPC_HOST, RPC_PORT, and credentials. Test with curl: curl --user user:pass --data-binary '{\"jsonrpc\":\"1.0\",\"id\":\"curl\",\"method\":\"getblockchaininfo\",\"params\":[]}' http://127.0.0.1:8332","cause":"The RPC URL is incorrect or server is not reachable.","error":"Error: unable to connect to RPC server"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}