py-flarchive is a very simple Python library for archiving the metadata for the Flickr photos belonging to a user.
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
flarchive
.gitignore
Makefile
README.md

README.md

py-flarchive

What is this?

py-flarchive is a very simple Python library for archiving the metadata for the Flickr photos belonging to a user. For all a user's photos the library will try to download and store the raw API (JSON) output for the following methods:

For example:

INFO:root:process photo ID 11331441996
DEBUG:root:calling flickr.photos.getInfo
DEBUG:root:creating ./data/16870059@N04/113/314/419/96
DEBUG:root:writing ./data/16870059@N04/113/314/419/96/11331441996-i.json
DEBUG:root:calling flickr.photos.getExif
DEBUG:root:writing ./data/16870059@N04/113/314/419/96/11331441996-e.json
DEBUG:root:calling flickr.photos.getSizes
DEBUG:root:writing ./data/16870059@N04/113/314/419/96/11331441996-s.json
DEBUG:root:calling flickr.photos.getAllContexts
DEBUG:root:writing ./data/16870059@N04/113/314/419/96/11331441996-ctx.json
DEBUG:root:calling flickr.photos.comments.getList
DEBUG:root:writing ./data/16870059@N04/113/314/419/96/11331441996-c.json

Usage

import flarchive

apikey='1234567'
apisecret=None
datadir='/where/to/write/files'

nsid='9999@N01'
authtoken=None

fl = flarchive.flickr(apikey, apisecret, datadir)
fl.archive_user(nsid, authtoken)

Or you can just call the flarchive __init__.py library from the command line:

$> python ./flarchive/__init__.py -v -a <APIKEY> -n <NSID> -d <DATA>

There are also a few helper make commands included with this with package:

$> make user APIKEY=<APIKEY> NSID=<NSID>

$> make list-commons APIKEY=<APIKEY>

Caveats

This has largely been optimized for public photo streams. It should work with private photos but there may still be bugs.

TO DO

  • Clean up auth token handling
  • Pagination for photo comments
  • Packaging, setup scripts and general spit and polish

See also