{"id":13937065,"url":"https://github.com/joshmarshall/jsonrpclib","last_synced_at":"2026-02-23T04:32:53.604Z","repository":{"id":43176420,"uuid":"919881","full_name":"joshmarshall/jsonrpclib","owner":"joshmarshall","description":"A Python JSON-RPC over HTTP that mirrors xmlrpclib syntax.","archived":false,"fork":false,"pushed_at":"2022-03-15T09:26:07.000Z","size":100,"stargazers_count":451,"open_issues_count":39,"forks_count":142,"subscribers_count":26,"default_branch":"master","last_synced_at":"2026-01-03T23:42:53.086Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshmarshall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-09-18T01:28:54.000Z","updated_at":"2025-11-04T07:14:52.000Z","dependencies_parsed_at":"2022-08-29T02:00:38.511Z","dependency_job_id":null,"html_url":"https://github.com/joshmarshall/jsonrpclib","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/joshmarshall/jsonrpclib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshmarshall%2Fjsonrpclib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshmarshall%2Fjsonrpclib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshmarshall%2Fjsonrpclib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshmarshall%2Fjsonrpclib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshmarshall","download_url":"https://codeload.github.com/joshmarshall/jsonrpclib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshmarshall%2Fjsonrpclib/sbom","scorecard":{"id":534170,"data":{"date":"2025-08-11","repo":{"name":"github.com/joshmarshall/jsonrpclib","commit":"7bbb278f02b30c69f71dff16fcc0ee48dc9fc051"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T06:30:39.376Z","repository_id":43176420,"created_at":"2025-08-20T06:30:39.376Z","updated_at":"2025-08-20T06:30:39.376Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29738079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T02:24:00.660Z","status":"ssl_error","status_checked_at":"2026-02-23T02:22:56.087Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-07T23:03:14.699Z","updated_at":"2026-02-23T04:32:53.583Z","avatar_url":"https://github.com/joshmarshall.png","language":"Python","funding_links":[],"categories":["Python","Awesome Python"],"sub_categories":["RPC Servers"],"readme":"[![Build Status](https://circleci.com/gh/joshmarshall/jsonrpclib.svg?style=svg)](https://circleci.com/gh/joshmarshall/jsonrpclib)\n\n\nJSONRPClib\n==========\nThis library is an implementation of the JSON-RPC specification.\nIt supports both the original 1.0 specification, as well as the \nnew (proposed) 2.0 spec, which includes batch submission, keyword\narguments, etc.\n\nIt is licensed under the Apache License, Version 2.0\n(http://www.apache.org/licenses/LICENSE-2.0.html).\n\nCommunication\n-------------\nFeel free to send any questions, comments, or patches to our Google Group \nmailing list (you'll need to join to send a message): \nhttp://groups.google.com/group/jsonrpclib\n\nSummary\n-------\nThis library implements the JSON-RPC 2.0 proposed specification in pure Python. \nIt is designed to be as compatible with the syntax of xmlrpclib as possible \n(it extends where possible), so that projects using xmlrpclib could easily be \nmodified to use JSON and experiment with the differences.\n\nIt is backwards-compatible with the 1.0 specification, and supports all of the \nnew proposed features of 2.0, including:\n\n* Batch submission (via MultiCall)\n* Keyword arguments\n* Notifications (both in a batch and 'normal')\n* Class translation using the 'jsonclass' key.\n\nI've added a \"SimpleJSONRPCServer\", which is intended to emulate the \n\"SimpleXMLRPCServer\" from the default Python distribution.\n\nRequirements\n------------\nIt supports cjson and simplejson, and looks for the parsers in that order \n(searching first for cjson, then for the \"built-in\" simplejson as json in 2.6+, \nand then the simplejson external library). One of these must be installed to \nuse this library, although if you have a standard distribution of 2.6+, you \nshould already have one. Keep in mind that cjson is supposed to be the \nquickest, I believe, so if you are going for full-on optimization you may \nwant to pick it up.\n\nInstallation\n------------\nYou can install this from PyPI with one of the following commands (sudo\nmay be required):\n\n\teasy_install jsonrpclib\n\tpip install jsonrpclib\n\nAlternatively, you can download the source from the github repository\nat http://github.com/joshmarshall/jsonrpclib and manually install it\nwith the following commands:\n\n\tgit clone git://github.com/joshmarshall/jsonrpclib.git\n\tcd jsonrpclib\n\tpython setup.py install\n\nClient Usage\n------------\n\nThis is (obviously) taken from a console session.\n\n\t\u003e\u003e\u003e import jsonrpclib\n\t\u003e\u003e\u003e server = jsonrpclib.Server('http://localhost:8080')\n\t\u003e\u003e\u003e server.add(5,6)\n\t11\n\t\u003e\u003e\u003e print jsonrpclib.history.request\n\t{\"jsonrpc\": \"2.0\", \"params\": [5, 6], \"id\": \"gb3c9g37\", \"method\": \"add\"}\n\t\u003e\u003e\u003e print jsonrpclib.history.response\n\t{'jsonrpc': '2.0', 'result': 11, 'id': 'gb3c9g37'}\n\t\u003e\u003e\u003e server.add(x=5, y=10)\n\t15\n\t\u003e\u003e\u003e server._notify.add(5,6)\n\t# No result returned...\n\t\u003e\u003e\u003e batch = jsonrpclib.MultiCall(server)\n\t\u003e\u003e\u003e batch.add(5, 6)\n\t\u003e\u003e\u003e batch.ping({'key':'value'})\n\t\u003e\u003e\u003e batch._notify.add(4, 30)\n\t\u003e\u003e\u003e results = batch()\n\t\u003e\u003e\u003e for result in results:\n\t\u003e\u003e\u003e ... print result\n\t11\n\t{'key': 'value'}\n\t# Note that there are only two responses -- this is according to spec.\n\nIf you need 1.0 functionality, there are a bunch of places you can pass that \nin, although the best is just to change the value on \njsonrpclib.config.version:\n\n\t\u003e\u003e\u003e import jsonrpclib\n\t\u003e\u003e\u003e jsonrpclib.config.version\n\t2.0\n\t\u003e\u003e\u003e jsonrpclib.config.version = 1.0\n\t\u003e\u003e\u003e server = jsonrpclib.Server('http://localhost:8080')\n\t\u003e\u003e\u003e server.add(7, 10)\n\t17\n\t\u003e\u003e\u003e print jsonrpclib..history.request\n\t{\"params\": [7, 10], \"id\": \"thes7tl2\", \"method\": \"add\"}\n\t\u003e\u003e\u003e print jsonrpclib.history.response\n\t{'id': 'thes7tl2', 'result': 17, 'error': None}\n\t\u003e\u003e\u003e \n\nThe equivalent loads and dumps functions also exist, although with minor \nmodifications. The dumps arguments are almost identical, but it adds three \narguments: rpcid for the 'id' key, version to specify the JSON-RPC \ncompatibility, and notify if it's a request that you want to be a \nnotification. \n\nAdditionally, the loads method does not return the params and method like \nxmlrpclib, but instead a.) parses for errors, raising ProtocolErrors, and \nb.) returns the entire structure of the request / response for manual parsing.\n\nSimpleJSONRPCServer\n-------------------\nThis is identical in usage (or should be) to the SimpleXMLRPCServer in the default Python install. Some of the differences in features are that it obviously supports notification, batch calls, class translation (if left on), etc. Note: The import line is slightly different from the regular SimpleXMLRPCServer, since the SimpleJSONRPCServer is distributed within the jsonrpclib library.\n\n\tfrom jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer\n\n\tserver = SimpleJSONRPCServer(('localhost', 8080))\n\tserver.register_function(pow)\n\tserver.register_function(lambda x,y: x+y, 'add')\n\tserver.register_function(lambda x: x, 'ping')\n\tserver.serve_forever()\n\nClass Translation\n-----------------\nI've recently added \"automatic\" class translation support, although it is \nturned off by default. This can be devastatingly slow if improperly used, so \nthe following is just a short list of things to keep in mind when using it.\n\n* Keep It (the object) Simple Stupid. (for exceptions, keep reading.)\n* Do not require init params (for exceptions, keep reading)\n* Getter properties without setters could be dangerous (read: not tested)\n\nIf any of the above are issues, use the _serialize method. (see usage below)\nThe server and client must BOTH have use_jsonclass configuration item on and \nthey must both have access to the same libraries used by the objects for \nthis to work.\n\nIf you have excessively nested arguments, it would be better to turn off the \ntranslation and manually invoke it on specific objects using \njsonrpclib.jsonclass.dump / jsonrpclib.jsonclass.load (since the default \nbehavior recursively goes through attributes and lists / dicts / tuples).\n\n[test_obj.py]\n\n\t# This object is /very/ simple, and the system will look through the \n\t# attributes and serialize what it can.\n\tclass TestObj(object):\n\t    foo = 'bar'\n\n\t# This object requires __init__ params, so it uses the _serialize method\n\t# and returns a tuple of init params and attribute values (the init params\n\t# can be a dict or a list, but the attribute values must be a dict.)\n\tclass TestSerial(object):\n\t    foo = 'bar'\n\t    def __init__(self, *args):\n\t        self.args = args\n\t    def _serialize(self):\n\t        return (self.args, {'foo':self.foo,})\n\n[usage]\n\n\timport jsonrpclib\n\timport test_obj\n\n\tjsonrpclib.config.use_jsonclass = True\n\n\ttestobj1 = test_obj.TestObj()\n\ttestobj2 = test_obj.TestSerial()\n\tserver = jsonrpclib.Server('http://localhost:8080')\n\t# The 'ping' just returns whatever is sent\n\tping1 = server.ping(testobj1)\n\tping2 = server.ping(testobj2)\n\tprint jsonrpclib.history.request\n\t# {\"jsonrpc\": \"2.0\", \"params\": [{\"__jsonclass__\": [\"test_obj.TestSerial\", [\"foo\"]]}], \"id\": \"a0l976iv\", \"method\": \"ping\"}\n\tprint jsonrpclib.history.result\n\t# {'jsonrpc': '2.0', 'result': \u003ctest_obj.TestSerial object at 0x2744590\u003e, 'id': 'a0l976iv'}\n\t\nTo turn on this behaviour, just set jsonrpclib.config.use_jsonclass to True. \nIf you want to use a different method for serialization, just set \njsonrpclib.config.serialize_method to the method name. Finally, if you are \nusing classes that you have defined in the implementation (as in, not a \nseparate library), you'll need to add those (on BOTH the server and the \nclient) using the jsonrpclib.config.classes.add() method. \n(Examples forthcoming.)\n\nFeedback on this \"feature\" is very, VERY much appreciated.\n\nWhy JSON-RPC?\n-------------\nIn my opinion, there are several reasons to choose JSON over XML for RPC:\n\n* Much simpler to read (I suppose this is opinion, but I know I'm right. :)\n* Size / Bandwidth - Main reason, a JSON object representation is just much smaller.\n* Parsing - JSON should be much quicker to parse than XML.\n* Easy class passing with jsonclass (when enabled)\n\nIn the interest of being fair, there are also a few reasons to choose XML \nover JSON:\n\n* Your server doesn't do JSON (rather obvious)\n* Wider XML-RPC support across APIs (can we change this? :))\n* Libraries are more established, i.e. more stable (Let's change this too.)\n\nTESTS\n-----\nI've dropped almost-verbatim tests from the JSON-RPC spec 2.0 page.\nYou can run it with:\n\n    pip install -r dev-requirements.txt\n    nosetests tests.py\n\nTODO\n----\n* Use HTTP error codes on SimpleJSONRPCServer\n* Test, test, test and optimize\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshmarshall%2Fjsonrpclib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshmarshall%2Fjsonrpclib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshmarshall%2Fjsonrpclib/lists"}