Best Twitter Framework for Python on App Engine? - python

I'm looking to incorporate twitter API features into an app engine project that I'm working on.
I'm relatively new to both app engine and python, so I'm wondering what modules/frameworks I should use to most easily incorporate twitter, and to facilitate twitter oauth?
I've seen:
python-twitter
tipfy
gaema

I heartily recomment tipfy, but, as its author #moraes just said, it is its own, little, lightweight framework -- integration with others is possible (through WSGI middleware concepts), but your life is much simpler if you stick with a single framework, and django is much richer (and, of course, much bigger and less simple -- those are two sides of the same coin;-) and very very popular.
I personally like the "very lightweight" approach of tipfy (and WSGI, and Werkzeug, on which it relies), but if you have to pick one single framework for a wide variety of uses, you could surely do much worse than going with the most popular one, that is, django (e.g. as this post suggests).

python-twitter is the strongest library for a do-it-yourself approach. You implement the API in your framework of choice. It is well-maintained code.
tipfy ported the TwitterMixin from Tornado, so you don't need to care about many implementation details. It is probably easier to get something done but it is integrated to tipfy, so you can't really use it as a library for other frameworks. Auth example is here.
gaema is also ported from Tornado, but it is unmaintained.
Theres also tweetapp, but the repository says that it is also not maintained.
Other frameworks may have similar helpers (or you can use a OAuth library).
Disclaimer: I'm author of tipfy and gaema.

I recommend using: Tweepy. There is an example app here: http://github.com/wasauce/tweepy-examples
Tweepy is under active development so I think it will serve you well.

I'm really liking Python Twitter Tools but I haven't yet incorporated it into an App Engine app. Will be soon though. Tweepy is next on my list to checkout.

Related

which python web framework(django or django-norel or pyramid) to use when MongoDB is used as a database

I am using MongoDB as my primary(and only till now) database and because of google and the links it provided me i am confused between Django or Pyramid.
I am comfortable with python but never done web development in python(i have done in PHP). Now because i will be using Mongo so i wont use Django ORM will that take away the ease of development people associate with Django?
I am new to Django(just a few hours) so i am not sure what parts of the framework the ORM affects.
Or should i go with the django fork django-norel with django mongodb engine (they are not actively maintained though) or should i use Pyramid because i plan to use jinja2 as my template layer so that makes 2 parts of django useless to me.
After removing these batteries from django does it still remain true that it a framework for people with deadlines?
Advice?
A year or two ago I was also deciding between django and pyramid w/ mongodb to build a high performance web application. I ultimately chose Pyramid :
Pros:
Pyramid is very light weight for a full stack framework. There is a minmal amount of 'magic' going on under the hood. I was able to wrap my head around all the pieces.
It is not as opinionated as Django. You can plug and play whatever templating engines or databases you need relatively easily.
I was impressed by the performance benchmarks between Pyramid over other full stack frameworks.
The Pylons/Pyramid culture of 100% code coverage and "only pay for what you eat" was appealing to my own development style.
Cons:
The community is growing, but still not as mature as Django
There's a lot of documentation, but it's not as robust as some of the Django docs out there
The lack of 'magic' and beginner friendly documentation make for a steeper learning curve.
As for using an ORM with MongoDB; I recommend you try building without one at first. After trying a few mongodb ORMs, I've ended up going back to plain pymongo with Colander or Validictory for validation. Pymongo is already very ORM-like, fast, and flexible. I felt the extra layers of abstraction took away from that flexibility, and caused me to write more code than was needed.
I'm going to suggest an alternative that has not been mentioned: Flask. Flask has a really great (albeit smaller than Django) community and there are a lot of extensions available for common web-app extensions, in the extensions directory.
There are several MongoDB extensions for Flask, which help to integrate MongoDB into the framework, but I would also highly recommend the mongoengine ORM. One of the people working on mongoengine has release an extension for Flask integration, Flask-MongoEngine.
Try it all (Django, Pyramid, Flask), read the docs, and you done.
If you will select Django, you will not use some parts of it (orm, formlib), and that is all.
ALso see this video:
https://www.10gen.com/presentations/mongosf-2011/mongodb-with-python-pylons-pyramid

Python REST frameworks for App Engine?

Any pointers, advice on implementing a REST API on App Engine with Python? Using webapp for the application itself.
What I currently know is that I can:
hack up my own webapp handlers for handling REST-like URIs, but this seems to lose its elegance for larger amounts of resources. I mean, it's simple when it comes to temperature/atlanta, but not so much* for even a rather simple /users/alice/address/work (though do keep in mind that I'm not saying this after having implemented that, just after spending some time trying to design an appropriate handler, so my perception may be off).
use the REST functionality provided by one of the bigger Python web frameworks out there. I have some unexplainable sympathy towards web2py, but, since it's not used for the project, bundling it with the application just to provide some REST functionality seems.. overkill?
(Huh, looks like I don't like any of these approaches. Tough.)
So here's me asking: what advice, preferably based on experience, would you have for me here? What are my options, is my view of them correct, did I miss something?
Thanks in advance.
I had a similar issue. Wanting to quickly get my DataStore exposed via REST to WebApps.
Found: AppEngine REST Server.
I have only used it lightly so far, but it certainly appears to be very useful with a small amount of work. And it does use webapp as you suggested.
ProtoRPC is bundled with the SDK, and it is robust and actively developed (however experimental). Although I think the source code itself is a little convoluted, the feature-set is pretty complete and it was made by someone with experience in creating this kind of library. It supports transmiting using JSON, ProtocolBuffer and URL-encoded formats.
Also, you can create APIs that work on the server side and client side -- it defines a 'message' protocol with implementations in Python and JavaScript. I used other "RESTful" Python libraries, but no other provided this consistency out of the box.
Here is the project page and here is the mailing list.
Edit: maybe their documentation is lacking some keywords, but just to be clear: one or the purposes of ProtoRPC is to provide a solid foundation to create REST services.

Python frameworks for developing facebook apps

I'd like to ask you about your experiences in developing facebook applications in Python. Which of the popular web frameworks for this language you think best suits this purpose? I know "best" is a very subjective word, so I'm specifically interested in the following:
Most reusable libraries. For example one might want to automatically create accounts for new logged in facebook users, but at the same time provide an alternative username + password logging functionality. I need authentication to fit into this nicely.
Facebook applications tend to differ from CMS-like sites. They are action intensive. For more complicated use-cases, usually some kind of caching for the data fetched from Open Graph API is required in order to be able to perform some queries on local and facebook data at once (for example join some tables based on friendship relation).
I'd definitely prefer popular solutions. They just seem to be much more stable and better thought through. I've previously developed a facebook application in Grails and I as much as I liked the architecture and the general ideas, the amount of bugs and complication that I ran into was just a little bit too much. Also Groovy is still quite an exotic language to develop in, and this time I'm not going to work on my own.
I'm not new to Python, but definitely new to web development in Python. Though after the experience with Grails and all its twists and turns I doubt Python could really scare me.
I would almost undoubtedly go with Django as the easiest and most popular framework for developing any type of web applications, if there's a need for a full-stack framework.
Specifically, in regards to Django's app universe, it is plentiful with many active applications -- but that has its downfalls too. There's no standard application for any 'one' thing, but there are a few applications that will do basically 90% of all that's needed. Sometimes the code is poorly written, but most of the time, the apps work and do what they are needed to do, so there's almost no need for someone to dive right in to the code.
Narrowing down our options, I have had great luck with Omab's Django-Social-Auth, which was absolutely a snap to integrate. It required 3 variables in my settings.py and I was up and running.
The only issue might be if you do not want to use the django.contrib.auth.User model, but, if you are not thinking about using that, I would think about that decision twice :)
To narrow it down even further, pyfacebook is another option for integrating Facebook. It comes with a djangofb application so it's just drop, add to settings.py and all is well. It even comes with an example Django application as part of the distribution. I've had pretty good luck with this application, but, I still think Omab's much easier to integrate.
Finally, Facebook's own python-sdk is easy to integrate from a raw standpoint, where they just give you access to their APIs using a simple Python API. However, it seems to cater more to the AppEngine folks, so YMMV.
I've used Django for quite some time. As of late I use Jinja2 instead. No particular reason, but it's another option
If you do not want to start on Django now. Try learning Flask(which is comparatively a lot easier to begin than Django) and then start building app with Flask.

I'm learning python and am interested in using it for web-scripting. What frameworkes are out there and do I need one?

I've been learning python for use in ArcGIS and some other non-web applications. However, now that I've taken on building a personal website I am interested in using it for web development (as it is the only scripting language I currently know).
I've noticed that there are a lot of these things called "frameworks", such as Django. From what I understand they are just a collection of packages to save you from re-inventing the wheel but I don't really know how they work.
Furthermore, I do not like GUIs, if I need a framework I would like to find one that could be used through a terminal, starts out simple and can be scaled for more complexity when I'm ready. Any advice or ideas on frameworks and why I would want to use one?
The Python web frameworks have nothing to do with GUIs, and can all be used via the terminal.
The benefits of a framework, as you say, are all to do with making your life easier by supplying the components you need to build a website: the main ones are database interaction through an ORM, a templating system, and URL routing. On top of that, the big frameworks also included optional extras like user authentication, administration interface, and so on.
Personally I like Django, but your mileage may vary: I would say, though, that whatever you do with Python and the web will require some sort of framework, even if it's one of the absolute minimal ones like Flask which basically do just the routing part. There's simply no point in writing all this stuff from scratch when it's been done for you.
I'd second the post above: Django is a great framework and will save you loads of time in the long run.
Pretty much every challenge you'll come across when writing a web application will already have been solved, e.g. How do I send emails? What about an admin interface to edit the data? User security?
In my view picking the best framework is all about the ecosystem around that framework. How well used is it? Is it discussed widely on the internet? Have others encountered, and solved, the problems I'm facing?
In terms of where you start, see the Django Tutorial here:
http://docs.djangoproject.com/en/1.2/intro/tutorial01/
If you think Django offers you too much, I'd recommend that you take a look at CherryPy just to compare the different, and much simpler, approach.
With Python, you've got lots of options. To start, I would recommend looking here -- it explains the basics and provides a fairly complete list of frameworks.
If you're looking for something that starts out simple but can also handle more complexity, then you should take a look at web2py. It requires no installation or configuration, has no dependencies, and includes a web server and a relational database. It also includes an optional web-based integrated development environment and admin interface, but you can work through the terminal instead if you prefer.
It's very easy to learn and was designed for ease of use, faster development, and security. You can get a lot done with very little code thanks to the included scaffolding app along with many sensible default behaviors. As things get more complex, web2py can handle it, as it is a well-integrated full-stack framework with lots of built-in functionality, including a database abstraction layer, form handling and validation, access control, web services, and easy Ajax integration.
Personnally, I don't use any framework, I write either from scratch on BaseHTTPServer, or using WSGI (with mod_wsgi).
It is a bit long to write the skeleton, but I think it is faster (I mean at runtime), there is less constraints, and there is lesser to learn.

app-engine-patch is dead. Now what is the best way to use Django on Google App Engine?

The app-engine-patch authors have officially marked this wonderful project as dead on their website. Over the last year a lot of people have asked what the best way to run Django on Google App Engine was, and time after time people have pointed to app-engine-patch being the way to go. Now that this project is dead, I would love to revisit this discussion and see what you all would recommend.
The old app-engine-patch website refers to a different project called djangoappengine that they are working on. It focuses on using Native Django on App Engine but by doing so appears to limit your ability to use all of App Engine's features (such as its built in User model). What do you all think about this as a replacement solution?
Does the Google App Engine Helper For Django project now look more inviting now that app-engine-patch has died?
Or is app-engine-patch still so great that you would recommend still using it despite it being dead?
I currently have a project in its middle stages relying on app-engine-patch and have loved using it so far, but am scared to continue using a project that is dead. I would really appreciate any comments you have about what you think the best long term solution is now. Thanks!
App engine patch is probably a safer bet for a given moment. Though not actively supported at the moment, it's still great, as it's been tested more thoroughly. If you're ready to take some risks - go and give the new djangoappengine+django-nonrel (native django support for non relational databases, primarily google datastore yest) option a try. That is the option we'll all use in a little while, so probably it's worth to try it out and not to look back. For instance, app engine patch only supports ~300 entities in the admin (i.e. doesn't take advantage of the 1.3.1 functionality), while with the djangoappengine+django-nonrel that is not an issues anymore. www.allbuttonspressed.com, a site of the guys behind app-engine-patch, is all built this new way, you can grab the source code of the site's skeleton # http://bitbucket.org/wkornewald/allbuttonspressed/.
good luck!
It looks like you can just import it using use_library...
http://code.google.com/appengine/docs/python/tools/libraries.html

Categories

Resources