[Devel] Options for building standardized APIs for OpenHatch
Mark Freeman
mark at timewasted.net
Wed Jul 13 17:02:10 UTC 2011
Hello team. I have begun research on adding some standardized APIs to
the OpenHatch code base. As I can certainly see these growing over
time and multiple people working on them, I want to make sure we
choose the best option going forward. I've received several
suggestions back from the general python community. Here is a list of
how I see our options at this point. I've made some general pro/con
statements for each. I'm extremely interested in everyone's feedback
before we make a decision and begin writing specifications and code.
Personally, my current leaning is toward tastypie or piston, with a
slight edge to tastypie due to the fact it is an active project.
Opinions?
* Option 1: Use Django's built in serialization options.
https://docs.djangoproject.com/en/dev/topics/serialization/
Pros:
1. Uses built in simplejson module or XMLSerializer
2. How it is implemented is pretty straight-forward
Cons:
1. You would need multiple views/paths to be able to support multiple formats
2. Home spun solution. Others probably already did it better.
* Option 2: Django-tastypie
https://github.com/toastdriven/django-tastypie and
http://django-tastypie.readthedocs.org/
Pros:
1. Automatically supports several data formats based on argument passed to view
2. Supports authentication if required
3. Supports throttling of calls to a view, if needed
4. Built to support good REST design
5. Actively being developed and growing user base
Cons:
1. Several external dependencies
2. Requires understand how the app works rather than just basic views
* Option 3: Django-piston
https://bitbucket.org/jespern/django-piston/wiki/Home
Pros:
1. Automatically supports several data formats based on argument passed to view
2. Supports authentication if required
3. Supports throttling of calls to a view, if needed
4. Built to support good REST design
5. Quite a few people using it
Cons:
1. Has not been actively developed for more than a year.
2. Multiple forks of the project which seem to address 1 issue or 2.
3. While it does have the larger community behind it, this seems to be
dying out with many people moving to tasty-pie
4. Feedback I got from most people was that piston works great, but
you have to generally tweak piston itself to get things working
correctly.
Mark
More information about the Devel
mailing list