Busy making things: tinycast, github, links, photos, @mc.

Backing Up Flickr Photos with Amazon S3

Posted: March 22nd, 2006 | Author: | Filed under: Open Source, Projects, Python, Web Services | 711 Comments »

I love that I now have an Amazon S3 billing page that reads like a really cheap phone or water bill. I think that they’re silently changing the game (again) without telling anyone else. I really like the implications of this magepiebrain post and decided to start using S3 “for real” myself last night.

The first ingredient was James Clarke’s flickr.py. Getting a list of my photos is pretty simple:

import flickr
me = flickr.people_findByUsername("postneo")
photos = flickr.people_getPublicPhotos(me.id)

The second ingredient for getting the job done was a pythonic wrapper around the Amazon example python libraries by Mitch Garnaat called BitBucket. Because it builds on the example libraries, there’s very little error checking, so be careful. Check out Mitch’s site for some example BitBucket usage, it’s pretty slick.

Once I was familiar with both libraries, I put together a little script that finds all of my photos and uploads the original quality image to S3, using the flickr photo ID as the key. Here’s the complete code for flickrbackup.py, all 25 lines of it.

After uploading 160 or so photos to Amazon, I owe them about a penny.

Getting photos back out is really easy too:

>>> import BitBucket
>>> bucket = BitBucket.BitBucket("postneo-flickr")
>>> bucket.keys()
>>> bits = bucket[u'116201243']
>>> bits.to_file("photo.jpg")

711 Comments on “Backing Up Flickr Photos with Amazon S3”

  1. 1 sreamer777 said at 11:36 am on February 13th, 2011:

    Дело касалось семьи палатку ворвался Тото и, задыхаясь, доложил разыскивала Эльсу, но безуспешно, мы только.
    [URL=http://besplatnye-znakomstva.rmweb.ru/klub-znakomstv-dlya-pravoslavnih.html]Клуб знакомств для православных[/URL]

  2. 2 Vigrx Plus pill said at 11:06 am on February 15th, 2011:

    I picture this may well be numerous upon the written content? nonetheless I nonetheless consider that it is usually suitable for nearly any type of matter subject matter, as a result of it could continuously be pleasurable to determine a heat and pleasant face or possibly listen a voice whilst preliminary landing.

  3. 3 Keva Ipson said at 5:01 pm on February 15th, 2011:

    Twitter had a tweet on Neiko Tools Air Tools that lead me hear for some reason. Not sure what this has to do with what I was looking for.

  4. 4 resguiden said at 3:38 am on February 16th, 2011:

    actually appreciated the article that you posted . it just isn’t that easy to discover good stuff to read (you know READ and not just going through it like a zombie before going to yet another post to just ignore), so cheers mate for not wasting any of my time! 🙂

  5. 5 Cheryll Delonais said at 8:58 am on February 16th, 2011:

    Twitter had a tweet on Discount Knife Warehouse Specials that lead me hear for some reason. Not sure what this has to do with what I was searching for.

  6. 6 best protein powder said at 1:48 am on February 17th, 2011:

    hdbrtnttdigqnblicvfb, best protein powder best protein powder for weight gain , gnijmax.

  7. 7 Nittyimmark said at 1:51 pm on February 17th, 2011:

    pz 026v w sw
    Массовая рассылка обьявлений на 8 тысяч 100 досок обьявлений а так же на 47 тысяч 500 закрытых форумов и о ваших самйтах и товарах сразу же узнают миллионы клиентов.- Мы разошлем рекламу в течении 30 минутпосле оплаты.- Всего 226 рубей за рассылку. – Качественно.С гарантией.- Заключаем договора на раскрутку и вывод в ТОР сайтов.- Наш тел. 89266853242 ICQ 568113539 почта: rutop10@mail.ru fh 042u s nr

  8. 8 hotfile.name said at 12:28 am on February 18th, 2011:

    [b]Кто хочет бесплатно [url=http://hotfile.name/soft/]скачать программы[/url] Soft
    [url=http://hotfile.name/soft/windows/32840-windows-7-ultimate-sp1-32bit-by-7dvd.html]windows 7 ultimate[/url] рэп r.
    X86 X64 Extended Lite, [url=http://hotfile.name/soft/14490-adobe-photoshop-cs5-1201-x86x64-extended-lite-ruen-unattended.html]скачать photoshop cs5[/url]

  9. 9 shoopedom said at 7:06 pm on February 18th, 2011:

    Бесплатная RPG онлайн игра Техномагия завоевала интерес тысяч пользователей различной возрастной категории оригинальным интерфейсом, геймплеем, игровым движком. Игра в стиле фэнтези совместила в себе элементы стратегии, тактики и логики. Мир Техномагии красочен и ярок, графика основана на флеш-анимации, при этом ее системные требования минимальны.

  10. 10 Rosario said at 7:01 am on February 19th, 2011:

    Mauro is the best 😛

    cheap dog insurance

  11. 11 Celia said at 5:50 am on February 20th, 2011:

    The most influential paper I have read today?!?


    free streaming downloads