Popular recipes by Raphaël Jolivet http://code.activestate.com/recipes/users/4135673/2011-11-07T10:25:56-08:00ActiveState Code RecipesTransparent HTTP Tunnel for Python sockets (to be used by ftplib ) (Python)
2011-11-07T10:25:56-08:00Raphaël Jolivethttp://code.activestate.com/recipes/users/4135673/http://code.activestate.com/recipes/577643-transparent-http-tunnel-for-python-sockets-to-be-u/
<p style="color: grey">
Python
recipe 577643
by <a href="/recipes/users/4135673/">Raphaël Jolivet</a>
(<a href="/recipes/tags/ftp/">ftp</a>, <a href="/recipes/tags/ftplib/">ftplib</a>, <a href="/recipes/tags/http/">http</a>, <a href="/recipes/tags/over/">over</a>, <a href="/recipes/tags/proxy/">proxy</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/socket/">socket</a>, <a href="/recipes/tags/socks/">socks</a>).
Revision 4.
</p>
<p>This script allows how to transparently install a HTTP proxy (proxy HTTP 1.1, using CONNECT command) on all outgoing sockets.</p>
<p>I did that to bring TCP over HTTP to FTPlib, transparently.
It should enable HTTP tunneling for all methods / modules that use the low-level socket API.</p>
Flatten XML to XPath syntax lines (Python)
2011-01-19T16:05:24-08:00Raphaël Jolivethttp://code.activestate.com/recipes/users/4135673/http://code.activestate.com/recipes/577547-flatten-xml-to-xpath-syntax-lines/
<p style="color: grey">
Python
recipe 577547
by <a href="/recipes/users/4135673/">Raphaël Jolivet</a>
(<a href="/recipes/tags/flatten/">flatten</a>, <a href="/recipes/tags/grep/">grep</a>, <a href="/recipes/tags/sed/">sed</a>, <a href="/recipes/tags/xml/">xml</a>, <a href="/recipes/tags/xpath/">xpath</a>).
</p>
<p>This script acts like <a href="http://www.ofb.net/~egnor/xml2/">xml2</a>.
It transforms a XML file into a flat text output, with <em>XPath</em>-like syntax, one line per XML node or attribute.
This format is more suitable for working with standard unix CLI utils (sed, grep, ... etc).</p>
Balance / Refunds of dues between friends (Python)
2011-04-26T16:11:15-07:00Raphaël Jolivethttp://code.activestate.com/recipes/users/4135673/http://code.activestate.com/recipes/577677-balance-refunds-of-dues-between-friends/
<p style="color: grey">
Python
recipe 577677
by <a href="/recipes/users/4135673/">Raphaël Jolivet</a>
(<a href="/recipes/tags/balance/">balance</a>, <a href="/recipes/tags/due/">due</a>, <a href="/recipes/tags/refund/">refund</a>, <a href="/recipes/tags/simplex/">simplex</a>).
</p>
<p>Here is a handy script that uses the <em>simplex</em> algorithm to compute an optimum list of refunds (for example, after a trip with shared expenses with friends).</p>
<p>It minimizes the number of transactions (refunds) required to reach the balance.</p>
jardiff (Python)
2011-03-22T15:00:28-07:00Raphaël Jolivethttp://code.activestate.com/recipes/users/4135673/http://code.activestate.com/recipes/577620-jardiff/
<p style="color: grey">
Python
recipe 577620
by <a href="/recipes/users/4135673/">Raphaël Jolivet</a>
(<a href="/recipes/tags/diff/">diff</a>, <a href="/recipes/tags/jar/">jar</a>, <a href="/recipes/tags/war/">war</a>, <a href="/recipes/tags/zip/">zip</a>).
</p>
<p>Diff JAR / WAR / ZIP files (even recursively bundled).</p>
<p>Possibility to ignore some files, or some patterns in text files (like MANIFEST.mf).</p>
<p>This script is useful in order to know if a new build has changed anything to your binary JAR/WAR/Zip.</p>
Cheetah template processor for CSV and XML data (Python)
2010-05-21T10:00:14-07:00Raphaël Jolivethttp://code.activestate.com/recipes/users/4135673/http://code.activestate.com/recipes/577234-cheetah-template-processor-for-csv-and-xml-data/
<p style="color: grey">
Python
recipe 577234
by <a href="/recipes/users/4135673/">Raphaël Jolivet</a>
(<a href="/recipes/tags/cheetah/">cheetah</a>, <a href="/recipes/tags/csv/">csv</a>, <a href="/recipes/tags/merge/">merge</a>, <a href="/recipes/tags/populate/">populate</a>, <a href="/recipes/tags/template/">template</a>, <a href="/recipes/tags/xml/">xml</a>).
</p>
<p>This script allows to populate Cheetah text templates (<a href="http://www.cheetahtemplate.org/" rel="nofollow">http://www.cheetahtemplate.org/</a>) with XML or CSV input data.</p>
<p>This is useful in my day2day work, where I often need to quickly generate bunch of files based on a templates and data.</p>
<p>Cheetah template are very easy to write and understand, and I find it easy to use with CSV or XML data.</p>
gzip pipe for asynchronous use (Python)
2008-03-24T21:47:17-07:00Raphaël Jolivethttp://code.activestate.com/recipes/users/4135673/http://code.activestate.com/recipes/551784-gzip-pipe-for-asynchronous-use/
<p style="color: grey">
Python
recipe 551784
by <a href="/recipes/users/4135673/">Raphaël Jolivet</a>
(<a href="/recipes/tags/files/">files</a>).
Revision 2.
</p>
<p>I've written a small class to handle a gzip pipe that won't read the whole source file at once, but will deliver small chunks of data on demand.</p>