Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python libraries for integrating Django with Facebook

I decide to write some applications using facebook and django (or even twisted, but it doesn't matter), and now I can't choose appropriate tools. I see there are many API-wrappers writed on Python exists for Facebook:

  • official, but seems no longer supported Python-SDK
  • new and actively developed, but seems too new Django-facebook
  • good old, but not maintained pyfacebook
  • simple, well-maintaned, but non-documented fandjango
  • some other very primitive tools

I saw some similar questions here, but I'm noticed that Facebook is periodically introduces big changes into their API and those advices may be already outdated, or may be new libraries appeared. Also I'd like to know about most significant differences between those libraries. And of course good documentation and tutorials are welcome.

like image 860
chuwy Avatar asked Oct 26 '11 08:10

chuwy


2 Answers

I think Django Facebook is a good choice for you. But my opinion is biased. I've written it for my startup Fashiolista.com and we run it in production. (Quite huge, so most edge cases have been resolved)

Django Facebook also include OpenFacebook, which is a python api client to the open graph protocol. It's the only python client I know which is fully up to date and actively maintained.

Have a look at: https://github.com/tschellenbach/Django-facebook

PS. Just released some new decorators which make it very simple to get started. These decorators are indeed very new and caused some bugs in the past days. The project itself is already a year old (since the open graph api was released) and otherwise quite stable. http://www.mellowmorning.com/

like image 135
Thierry Avatar answered Sep 27 '22 19:09

Thierry


The answer really depends on what it is you want to achieve as those APIs are pretty different.

  • pyfacebook - is for the older legacy API.

  • python-sdk - is for the "new" opengraph protocol (I wouldn't say its no longer supported as its just a thin wrapper over the facebook opengraph protocol, so supports all the new features that facebook provide instantly w/out needing dev work on the lib).

  • django-facebook - is a higher level than python-sdk and helps you to add facebook connection features to your site and also seems to pave the way to creating apps that live "inside" facebook rather than just helping sites that live outside facebook to get access to facebook data.

  • Never heard of fandjango and github seems to be down at the moment so can't comment on that.

If you just want to add user-login using facebook then something like django-socialauth might work out well for you.

If you want to start exploring the social graph then python-sdk is the way to go.

I'd also check to see if the functions you want are supported by the opengraph protocol, its improved over the last year but there is the odd thing it frustratingly doesn't support whereas the legacy api does support...

The best documentation is facebook itself, check out the graph-explorer - it's pretty fascinating...

like image 37
jawache Avatar answered Sep 27 '22 18:09

jawache