Popular recipes tagged "meta:requires=xmlrpclib"http://code.activestate.com/recipes/tags/meta:requires=xmlrpclib/2011-05-19T17:54:43-07:00ActiveState Code RecipesCheck for package updates on PyPI (works best in pip+virtualenv) (Python) 2011-05-19T17:54:43-07:00Artur Siekielskihttp://code.activestate.com/recipes/users/4177664/http://code.activestate.com/recipes/577708-check-for-package-updates-on-pypi-works-best-in-pi/ <p style="color: grey"> Python recipe 577708 by <a href="/recipes/users/4177664/">Artur Siekielski</a> (<a href="/recipes/tags/pip/">pip</a>, <a href="/recipes/tags/pypi/">pypi</a>, <a href="/recipes/tags/virtualenv/">virtualenv</a>). </p> <p>Pip has an option to upgrade a package (_pip install -U_), however it always downloads sources even if there is already a newest version installed. If you want to check updates for all installed packages then some scripting is required.</p> <p>This script checks if there is a newer version on PyPI for every installed package. It only prints information about available version and doesn't do any updates. Example output:</p> <pre class="prettyprint"><code>distribute 0.6.15 0.6.16 available Baker 1.1 up to date Django 1.3 up to date ipython 0.10.2 up to date gunicorn 0.12.1 0.12.2 available pyprof2calltree 1.1.0 up to date profilestats 1.0.2 up to date mercurial 1.8.3 up to date </code></pre> Move Firefly/Trac wiki pages (Python) 2010-02-22T12:54:33-08:00Troy Topnikhttp://code.activestate.com/recipes/users/4165698/http://code.activestate.com/recipes/577062-move-fireflytrac-wiki-pages/ <p style="color: grey"> Python recipe 577062 by <a href="/recipes/users/4165698/">Troy Topnik</a> (<a href="/recipes/tags/firefly/">firefly</a>, <a href="/recipes/tags/trac/">trac</a>, <a href="/recipes/tags/wiki/">wiki</a>, <a href="/recipes/tags/xmlrpc/">xmlrpc</a>). Revision 2. </p> <p>Moves all wiki pages from one Firefly (Trac) project to another (optionally deleting all wiki pages in the target project first).</p> <p>The full xml-rpc API can be found in every Firefly project. For example: <a href="http://firefly.activestate.com/troyt/sandbox/xmlrpc" rel="nofollow">http://firefly.activestate.com/troyt/sandbox/xmlrpc</a></p> JSON RPC Server and client (Python) 2008-04-01T09:50:49-07:00david decotignyhttp://code.activestate.com/recipes/users/4129454/http://code.activestate.com/recipes/552751-json-rpc-server-and-client/ <p style="color: grey"> Python recipe 552751 by <a href="/recipes/users/4129454/">david decotigny</a> (<a href="/recipes/tags/network/">network</a>). </p> <p>This recipe shows how to create JSON RPC client and server objects. The aim is to mimic the standard python XML-RPC API both on the client and server sides, but using JSON marshalling. It depends on cjson (<a href="http://pypi.python.org/pypi/python-cjson" rel="nofollow">http://pypi.python.org/pypi/python-cjson</a>) for the encoding/decoding of JSON data. This recipe tries to reuse the code of XML-RPC as much as possible.</p> Twisted XML RPC server with basic HTTP authentication (Python) 2007-08-09T09:48:48-07:00Anandhttp://code.activestate.com/recipes/users/760763/http://code.activestate.com/recipes/526625-twisted-xml-rpc-server-with-basic-http-authenticat/ <p style="color: grey"> Python recipe 526625 by <a href="/recipes/users/760763/">Anand</a> (<a href="/recipes/tags/web/">web</a>). Revision 3. </p> <p>This recipe illustrates an XML RPC server using twisted with support for HTTP basic client authentication.</p> using xmlrpc with authenticated proxy server (Python) 2007-07-03T23:42:04-07:00Vaibhav Bhatiahttp://code.activestate.com/recipes/users/4007166/http://code.activestate.com/recipes/523016-using-xmlrpc-with-authenticated-proxy-server/ <p style="color: grey"> Python recipe 523016 by <a href="/recipes/users/4007166/">Vaibhav Bhatia</a> (<a href="/recipes/tags/web/">web</a>). </p> <p>To access an XML-RPC server through a proxy which requires authentication, you need to define a custom transport. the custom transport mentioned in the python docs, allows only proxy server's which do not require authentication. (<a href="http://docs.python.org/lib/xmlrpc-client-example.html" rel="nofollow">http://docs.python.org/lib/xmlrpc-client-example.html</a>). Have tried to use urllib which has support for proxy server and added the headers required for authentication. Idea to use urllib was taken from this thread (<a href="http://mail.python.org/pipermail/python-list/2001-July/098183.html%29" rel="nofollow">http://mail.python.org/pipermail/python-list/2001-July/098183.html)</a></p> xmlrpc server/client which does cookie handling and supports basic authentication (Python) 2007-01-23T10:51:39-08:00Vaibhav Bhatiahttp://code.activestate.com/recipes/users/4007166/http://code.activestate.com/recipes/501148-xmlrpc-serverclient-which-does-cookie-handling-and/ <p style="color: grey"> Python recipe 501148 by <a href="/recipes/users/4007166/">Vaibhav Bhatia</a> (<a href="/recipes/tags/web/">web</a>). </p> <p>xmlrpc server client which do the following: * client sends a request with basic authentication * server on successful authentication sends response back and also sends cookies with authentication id * these cookies are saved by client and then used for authentication on any subsequent requests</p> Simple XML RPC server over HTTPS (Python) 2006-06-07T07:17:34-07:00Laszlo Nagyhttp://code.activestate.com/recipes/users/2914829/http://code.activestate.com/recipes/496786-simple-xml-rpc-server-over-https/ <p style="color: grey"> Python recipe 496786 by <a href="/recipes/users/2914829/">Laszlo Nagy</a> (<a href="/recipes/tags/web/">web</a>). </p> <p>Simple program that demonstrates how to write an XMLRCP server that uses https for transporting XML data.</p> Ping Technocrati with your blog URL (Python) 2006-10-31T07:42:07-08:00Mayuresh Phadkehttp://code.activestate.com/recipes/users/4009783/http://code.activestate.com/recipes/498232-ping-technocrati-with-your-blog-url/ <p style="color: grey"> Python recipe 498232 by <a href="/recipes/users/4009783/">Mayuresh Phadke</a> (<a href="/recipes/tags/web/">web</a>). Revision 2. </p> <p>Technocrati (<a href="http://www.technorati.com/" rel="nofollow">http://www.technorati.com/</a>) maintains a list of blogs tagged with user specified tags. People can submit their blogs for inclusion in Technocrati by using their RPC ping service at <a href="http://www.technorati.com/ping" rel="nofollow">http://www.technorati.com/ping</a>. This piece of code allows you ping Technocrati with blog details through a script.</p> Authenticate with twisted.web.xmlrpc (Python) 2006-09-05T18:09:47-07:00Duncan McGreggorhttp://code.activestate.com/recipes/users/1923213/http://code.activestate.com/recipes/473865-authenticate-with-twistedwebxmlrpc/ <p style="color: grey"> Python recipe 473865 by <a href="/recipes/users/1923213/">Duncan McGreggor</a> (<a href="/recipes/tags/network/">network</a>). Revision 2. </p> <p>These classes subclass several of the culprits in twisted.web.xmlrpc that are responsible for not being able to make autenticated XML-RPC calls.</p> <p>Note that this recipe also makes use of the URI classes that were posted in a previous recipe here: <a href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473864" rel="nofollow">http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473864</a></p> <p>I will submit a patch to twisted along these lines, but there will be no references to the custom Uri module or code.</p> <p>Update: XML-RPC Authentication is now supported in Twisted (version 2.4 included a patch based on this recipe). If you are using a recent version of Twisted or can update to a recent version, this recipe is no longer needed.</p> Authenticating Twisted with Zope/Plone (Python) 2006-02-08T00:19:44-08:00Duncan McGreggorhttp://code.activestate.com/recipes/users/1923213/http://code.activestate.com/recipes/473838-authenticating-twisted-with-zopeplone/ <p style="color: grey"> Python recipe 473838 by <a href="/recipes/users/1923213/">Duncan McGreggor</a> (<a href="/recipes/tags/web/">web</a>). Revision 8. </p> <p>I was writing a custom Twisted XML-RPC server for radio station DJs to use, but one station was managing all of its internal web app users and groups through Zope. Twisted has an amazingly pluggable authentication framework, so the requirement was satisfied with the following.</p> <p>Note that in this simple example, every time a user executes an XML-RPC method, they are authenticating against Zope. This involves an xmlrpclib.ServerProxy instantiation as well as the overhead of making a network connection to Zope. For this reason, as well as in the event of Zope being down, one might want to implement some form of caching (without passwords), so that application functionality is not impacted by Zope downtime and overhead from authentication is only incurred when necessary.</p> <p>radix makes a very good point in the comments: the use of xmlrpclib in this recipe is blocking. This means that if you have 10, 20, whatever number of people using the app, and someone new logs in, the twisted reactor can't do it's usual thing and cycle through requests until that user finishes logging in. I will post an update that makes use of the non-blocking t.w.xmlrpc code. The solution will be messier, though, as t.w.xmlrpc is broken in that it doesn't handle scheme://username:pass@host:port URLs. This is due to the fact that t.w.xmlrpc.QueryProtocol doesn't set an Authentication header... and there's no mechanism in t.w.xmlrpc.Proxy and QueryFactory for parsing and setting user and password into from the URL.</p> <p>Update: see the comments below for how to work around this limitation.</p> serving dynamically-generated PDF files via XML/RPC (Python) 2005-05-05T23:41:15-07:00gian paolo cicerihttp://code.activestate.com/recipes/users/631476/http://code.activestate.com/recipes/413404-serving-dynamically-generated-pdf-files-via-xmlrpc/ <p style="color: grey"> Python recipe 413404 by <a href="/recipes/users/631476/">gian paolo ciceri</a> (<a href="/recipes/tags/distributed/">distributed</a>). </p> <p>It's only a matter to put together Reportlab to generate a pdf file on the fly and Cherrypy xmlrpc filter to serve it as an XML/RPC binary object (base64-encoded).</p> Transmitting exceptions through XML-RPC (Python) 2005-01-31T17:37:28-08:00A.M. Kuchlinghttp://code.activestate.com/recipes/users/681412/http://code.activestate.com/recipes/365244-transmitting-exceptions-through-xml-rpc/ <p style="color: grey"> Python recipe 365244 by <a href="/recipes/users/681412/">A.M. Kuchling</a> (<a href="/recipes/tags/web/">web</a>). </p> <p>Python's xmlrpclib only raises the xmlrpclib.Fault exception, but it can be convenient to allow more different kinds of exceptions to be raised. This recipe provides a customized subclass of xmlrpclib.ServerProxy that looks for Fault exceptions where the message is of the form &lt;exception name&gt;:&lt;message&gt;, and raises the corresponding exception.</p> Import modules from a remote server. (Python) 2004-09-14T06:03:38-07:00S Whttp://code.activestate.com/recipes/users/1759688/http://code.activestate.com/recipes/305277-import-modules-from-a-remote-server/ <p style="color: grey"> Python recipe 305277 by <a href="/recipes/users/1759688/">S W</a> (<a href="/recipes/tags/network/">network</a>). </p> <p>Storing modules in a central location, which are used by remote, seperate clients has obvious benefits. This recipe describes a method by which modules can be fetched from a remote server and compiled into bytecode modules which are used by the client.</p> <p>The recipe has 3 sections (server.py, client.py, test.py) which need to be copied into 3 files.</p> xmlrpc parameter mapping for OO-style programming. (Python) 2004-12-17T06:18:46-08:00Diez Roggischhttp://code.activestate.com/recipes/users/2216384/http://code.activestate.com/recipes/359874-xmlrpc-parameter-mapping-for-oo-style-programming/ <p style="color: grey"> Python recipe 359874 by <a href="/recipes/users/2216384/">Diez Roggisch</a> (<a href="/recipes/tags/network/">network</a>). </p> <p>This recipe automates the creation and lookup of objects passed from and to xmlrpc server methods so that incoming calls arguments are automatically replaced by their respective objects, and returned objects get mapped and their ids returned.</p> Enable xmlrpclib to maintain a JSP session (Python) 2002-11-10T08:46:45-08:00Danny Yoohttp://code.activestate.com/recipes/users/98032/http://code.activestate.com/recipes/161816-enable-xmlrpclib-to-maintain-a-jsp-session/ <p style="color: grey"> Python recipe 161816 by <a href="/recipes/users/98032/">Danny Yoo</a> . </p> <p>This extension to xmlrpclib allows us to maintain a session with a JSP server, so that there appears to be a stateful session. It tries to maintain the JSESSIONID call between calls to the server.</p> A simple XML-RPC server (Python) 2001-10-13T11:34:19-07:00Brian Quinlanhttp://code.activestate.com/recipes/users/118989/http://code.activestate.com/recipes/81549-a-simple-xml-rpc-server/ <p style="color: grey"> Python recipe 81549 by <a href="/recipes/users/118989/">Brian Quinlan</a> (<a href="/recipes/tags/web/">web</a>). </p> <p>This recipe demonstrates the creation of a simple XML-RPC server using the SimpleXMLRPCServer class. It requires either Python 2.2 or later or the XML-RPC package from PythonWare (<a href="http://www.pythonware.com/products/xmlrpc/index.htm" rel="nofollow">http://www.pythonware.com/products/xmlrpc/index.htm</a>) to run.</p> Remote database access using XML-RPC and SOAP. (Python) 2001-11-01T00:42:22-08:00Graham Dumpletonhttp://code.activestate.com/recipes/users/135831/http://code.activestate.com/recipes/81613-remote-database-access-using-xml-rpc-and-soap/ <p style="color: grey"> Python recipe 81613 by <a href="/recipes/users/135831/">Graham Dumpleton</a> (<a href="/recipes/tags/database/">database</a>). Revision 3. </p> <p>Shows how to remotely access a database via a web service supporting XML-RPC and SOAP protocols. The example uses the MySQLdb module, but should be easily customised to any database with Python module adhering to the Python DB API. The web service interface provides the ability to make a self contained query, or allows the creation of a distinct database cursor to service a series of queries or updates without other clients interfering. Cursors automatically expire and delete themselves after a set period of inactivity if not explicitly closed.</p> Web service accessible using both XML-RPC and SOAP protocols. (Python) 2001-11-01T00:48:32-08:00Graham Dumpletonhttp://code.activestate.com/recipes/users/135831/http://code.activestate.com/recipes/81612-web-service-accessible-using-both-xml-rpc-and-soap/ <p style="color: grey"> Python recipe 81612 by <a href="/recipes/users/135831/">Graham Dumpleton</a> (<a href="/recipes/tags/web/">web</a>). Revision 3. </p> <p>This is yet another example of an XML-RPC capable web service. Where this example is different though, is that the service can be accessed at the same time using the SOAP protocol. Confusion is avoided by clients for each protocol using different URLs to access the service.</p> Using xml-rpc (Python) 2001-08-17T00:13:10-07:00andy mckayhttp://code.activestate.com/recipes/users/92886/http://code.activestate.com/recipes/56034-using-xml-rpc/ <p style="color: grey"> Python recipe 56034 by <a href="/recipes/users/92886/">andy mckay</a> (<a href="/recipes/tags/xml/">xml</a>). Revision 4. </p> <p>This simple recipe shows how you can pull recipes from O'Reilly's meerkat service using xml-rpc.</p> Make an XML-RPC method call (Python) 2001-03-12T00:06:36-08:00Rael Dornfesthttp://code.activestate.com/recipes/users/98111/http://code.activestate.com/recipes/52214-make-an-xml-rpc-method-call/ <p style="color: grey"> Python recipe 52214 by <a href="/recipes/users/98111/">Rael Dornfest</a> . </p> <p>Make a method call to an XML-RPC server using xmlrpclib (<a href="http://www.pythonware.com/products/xmlrpc/%29." rel="nofollow">http://www.pythonware.com/products/xmlrpc/).</a></p>