Popular recipes tagged "aws" but not "logging"http://code.activestate.com/recipes/tags/aws-logging/2014-11-06T18:31:44-08:00ActiveState Code RecipesUrllib handler for Amazon S3 buckets (Python) 2014-11-06T18:31:44-08:00Andrea Corbellinihttp://code.activestate.com/recipes/users/4186880/http://code.activestate.com/recipes/578957-urllib-handler-for-amazon-s3-buckets/ <p style="color: grey"> Python recipe 578957 by <a href="/recipes/users/4186880/">Andrea Corbellini</a> (<a href="/recipes/tags/aws/">aws</a>, <a href="/recipes/tags/s3/">s3</a>, <a href="/recipes/tags/urllib/">urllib</a>). </p> <p>This is a handler for the standard <a href="https://docs.python.org/dev/library/urllib.request.html">urllib.request</a> module capable of opening buckets stored on <a href="http://aws.amazon.com/s3/">Amazon S3</a>.</p> <p>Here is an usage example:</p> <pre class="prettyprint"><code>&gt;&gt;&gt; from urllib.request import build_opener &gt;&gt;&gt; opener = build_opener(S3Handler) &gt;&gt;&gt; response = opener.open('s3://bucket-name/key-name') &gt;&gt;&gt; response.read() b'contents' </code></pre>