<div dir="ltr">2013/5/24 Itamar Turner-Trauring <span dir="ltr">&lt;<a href="mailto:itamar@futurefoundries.com" target="_blank">itamar@futurefoundries.com</a>&gt;</span><br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Crochet is an MIT-licensed library that makes it easier for threaded
applications like Flask or Django to use the Twisted networking framework. Features include:<br><ul><li>Runs Twisted&#39;s reactor in a thread it manages.</li><li>Hooks up Twisted&#39;s log system to the Python standard library <tt>logging</tt>
framework. Unlike Twisted&#39;s built-in <tt>logging</tt> bridge, this includes
support for blocking <cite>Handler</cite> instances.</li><li>Provides a blocking API to eventual results (i.e. <tt>Deferred</tt> instances).</li></ul>This release includes better documentation and API improvements, as well as better error reporting.<br>

<br></div><div>Here is a simple example of using Crochet:<br><pre><span>import</span> <span>sys</span>

<span>from</span> <span>twisted.web.client</span> <span>import</span> <span>getPage</span>
<span>from</span> <span>crochet</span> <span>import</span> <span>setup</span><span>,</span> <span>run_in_reactor</span>
<span>crochet</span><span>.</span><span>setup</span><span>()</span>

<span>@run_in_reactor</span>
<span>def</span> <span>download_page</span><span>(</span><span>url</span><span>):</span>
    <span>return</span> <span>getPage</span><span>(</span><span>url</span><span>)</span>

<span>result</span> <span>=</span> <span>download_page</span><span>(</span><span>sys</span><span>.</span><span>argv</span><span>[</span><span>1</span><span>])</span>
<span># wait() returns the result when it becomes available:</span>
<span>print</span> <span>result</span><span>.</span><span>wait</span><span>()</span></pre><br></div>You can see more examples, read the documentation, and download the package at:<br>
<br><a href="https://pypi.python.org/pypi/crochet" target="_blank">https://pypi.python.org/pypi/crochet</a></div></blockquote><div><br></div><div><br></div><div style>Awesome awesome awesome awesome.</div><div style><br>
</div><div style>Also, awesome.</div><div style><br></div></div>-- <br>--Dave Peticolas
</div></div>