The easiest way (in my mind) is to use the awesome requests
library. You can fetch each image from the server one at a time, then open it with Image()
:
from StringIO import StringIO
import requests
from pgmagick import Image, Blob
r = requests.get('https://server.com/path/to/image1.png', auth=('user', 'pass'))
img = Image(Blob(StringIO(r.content)))
And that's all there is to it. Authentication is of course not required, but may be necessary depending on your S3 setup. Have fun!