public
Description: A Python wrapper to the Phanfare API
Homepage: http://altmansoftware.lighthouseapp.com/projects/10199-pyphanfare/overview
Clone URL: git://github.com/paltman/pyphanfare.git
Click here to lend your support to: pyphanfare and make a donation at www.pledgie.com !
pyphanfare / all_images.py
100644 24 lines (20 sloc) 0.765 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from pyphanfare.connection import PhanfareConnection
 
def list_all():
    filesize = 0
    c = PhanfareConnection()
    c.authenticate()
    albums = c.account.get_albums()
    
    for album in albums:
        print album.name
        images = album.get_images(external_links=True, num_images=2000)
        for i in range(0, len(images)):
            for r in images[i].renditions:
                if r['rendition_type'] == 'Full':
                    typ = 'I'
                    if images[i].is_video:
                        typ = 'V'
                    print '%s - %s - %s - %s' % (i, typ, str(images[i].image_date), r['url'])
                    filesize += r['filesize']
        print ''
    print 'Total in storage at Phanfare: %s' % filesize
 
list_all()