{"id":5270,"library":"jsonrpclib","title":"jsonrpclib","description":"jsonrpclib is a Python client library implementing the JSON-RPC v2.0 specification, with backwards compatibility considerations. It focuses on providing client-side functionality for interacting with JSON-RPC servers. The current version is 0.2.1. The project has seen limited updates since 2021; for more active development or server-side functionality, consider `jsonrpclib-pelix`.","status":"maintenance","version":"0.2.1","language":"en","source_language":"en","source_url":"https://github.com/joshmarshall/jsonrpclib","tags":["JSON-RPC","client","RPC"],"install":[{"cmd":"pip install jsonrpclib","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"Server","correct":"from jsonrpclib import Server"}],"quickstart":{"code":"import os\nfrom jsonrpclib import Server\n\n# This quickstart demonstrates client-side usage.\n# A JSON-RPC server must be running at the specified URL for this code to connect and execute.\n# For demonstration purposes, we use a placeholder URL.\n# Replace with your actual server URL or set via environment variable.\nSERVER_URL = os.environ.get('JSONRPCLIB_SERVER_URL', 'http://localhost:8080/jsonrpc')\n\ntry:\n    # Create a server proxy\n    server = Server(SERVER_URL)\n\n    # Example: Call a simple method (e.g., 'add' with two arguments)\n    # The actual methods available depend on the connected JSON-RPC server.\n    print(f\"Attempting to call 'add(5, 3)' on {SERVER_URL}...\")\n    # This call will fail if no server is running or if the method doesn't exist.\n    result_add = server.add(5, 3)\n    print(f\"Result of server.add(5, 3): {result_add}\")\n\n    # Example: Access a method within a namespace (if supported by the server)\n    # e.g., 'system.get_info()'\n    print(f\"Attempting to call 'system.get_info()' on {SERVER_URL}...\")\n    # This call will fail if no server is running or if the namespace/method doesn't exist.\n    system_info = server.system.get_info()\n    print(f\"System info from server.system.get_info(): {system_info}\")\n\nexcept Exception as e:\n    print(f\"Error connecting to or calling JSON-RPC server at {SERVER_URL}: {e}\")\n    print(\"Please ensure a JSON-RPC server is running at the specified URL and provides the called methods.\")\n","lang":"python","description":"This example shows how to create a client proxy and call methods on a remote JSON-RPC server. It requires a server to be running at `SERVER_URL` for the calls to succeed. Error handling for connection issues is included."},"warnings":[{"fix":"Ensure your environment is running Python 3.5+ (as per `requires_python` in `setup.py`). Migrate any Python 2 specific code if upgrading from a very old version.","message":"Python 2 support was officially dropped in version 0.1.0. Older versions of `jsonrpclib` were Python 2 compatible, but the current maintainer has transitioned to Python 3 exclusively.","severity":"breaking","affected_versions":"All versions from 0.1.0 onwards."},{"fix":"If you need to implement a JSON-RPC server, consider using libraries specifically designed for server-side RPC, such as `jsonrpclib-pelix` (from the same author) or other Python web frameworks with JSON-RPC extensions.","message":"jsonrpclib is a client-only library. It does not provide functionality for implementing a JSON-RPC server. Attempts to use it for server-side logic will fail.","severity":"gotcha","affected_versions":"All versions."},{"fix":"Evaluate `jsonrpclib-pelix` (available on PyPI) as a more actively maintained and feature-rich alternative that also supports server implementations.","message":"The `jsonrpclib` project has not seen significant updates or active maintenance since April 2021. For new projects or if active development, bug fixes, or server-side functionality are critical, consider using `jsonrpclib-pelix`.","severity":"gotcha","affected_versions":"All versions, especially 0.2.1."}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}