GalleryRemote Python package
fprimex
Joined: 2008-08-11
Posts: 3 |
![]() |
Hi all, I recently updated some code I found for accessing Gallery using Python. The result is the GalleryRemote package, available at my website and registered with Pypi. This is a package containing a class which implements the bulk of the Gallery Remote protocol. I would appreciate your comments and testing. I did this work for a migration and will not be doing much more work with this package myself. Happy to fix problems and get it out of the dev status and into stable with some use by you all. Info on my homepage: Listing on Pypi: Install with: |
|
paour
![]()
Joined: 2002-08-14
Posts: 1479 |
![]() |
Feel free to publicize your code on this page. -- |
|
fprimex
Joined: 2008-08-11
Posts: 3 |
![]() |
Done, thanks. Added links to the updated Python interface on that page. |
|
jmsizun
Joined: 2008-11-09
Posts: 2 |
![]() |
Hello all, I downloaded the librarie and suceeded to connect and fetch album and album info from my gallery2 serveur. Moreover, what is the proper way to construct the URL to download a given image? regards, Jean-Michel |
|
fprimex
Joined: 2008-08-11
Posts: 3 |
![]() |
Hi jmsizun, The current implementation does not handle g2_authToken, though this could be added. I've been meaning to set up Gallery1 and Gallery2 in MAMP and do some testing and further development; just haven't had time. For my migration project, in which I connected to Gallery2, I downloaded the images with: url = "http://your-gallery-site/gallery2" username = 'gallery_username' password = 'gallery_password' gallery = Gallery2(url) gallery.login(username, password) images = gallery.fetch_album_images(album['name']) for image in images: image_url = url + "/main.php?g2_view=core.DownloadItem&g2_itemId=" + image['name'] opener = urllib2.build_opener(urllib2.ProxyHandler({})) connection = opener.open(image_url) image_data = connection.read() # do whatever with the image file data here |
|