[ANN] jsonrpclib for accessing JSON-RPC from python

matt matthewharrison at gmail.com
Mon Mar 27 22:31:07 CEST 2006


Folks-

I've created some python code for accessing JSON-RPC (think xmlrpc but
replace XML with JSON).  I've written an article about it here:
http://developer.spikesource.com/wiki/index.php/Article:Accessing_JSON-RPC_with_Python

Let me know if you have any questions or feedback.

I also have a question for the python community on coding style.  As I
said above, replace xml with JSON, well that's basically what I did.  I
took the code for xmlrpclib and made it serialize to json instead of
xml.  I didn't subclass xmlrpclib.ServerProxy, but probably could have
and made the library about 15 lines of code rather than 300.

I didn't because I thought it made the code more understandable if it
was all in one place.  Also, if in the code diverges in the future, it
will be less confusing.

Should I have subclassed?  Or should xmlrpclib be refactored to
FOOrpclib, and have xmlrpclib and jsonrpclib derive from them?
(Probably not, since it's in the stdlib...)

thanks

matt




More information about the Python-list mailing list