This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
pyphanfare / README.markdown
pyphanfare
Configuration
Configuration is handled in either a system wide configuration file placed at:
/etc/pyphanfare.cfg
or a user based configuration file at:
~/.pyphanfare
The sections available for configuring are:
[Credentials]
email = <phanfare email>
password = <phanfare password>
api_key = <phanfare api key>
private_key = <phanfare private key>
[General]
api_url = http://www.phanfare.com/api/?
debug = True
The api_url parameters under General is optional and defaults to http://www.phanfare.com/api/? if nothing is specified in the file.
The three parameters, username, password, and api_key, under Credentials are required and are the bare minimum to be found in the configuration files.
Whatever is in the ~/.pyphanfare user file will override whatever is stored in the system /etc/pyphanfare.cfg file.
Example
While the API is not fully complete, this bit of sample code works demonstrating the ability to enumerate very quickly your entire collection on Phanfare:
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()








