As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I realize this is a bit of a lazyweb question, but I wanted to see which python library for Twitter people have had good experiences with.
I've used Python Twitter Tools and like its brevity and beauty of interface, but it doesn't seem to be one of the popular ones - it's not even listed on the Twitter Libraries page.
There are, however, plenty of others listed:
oauth-python-twitter2 by Konpaku Kogasa. Combines python-twitter and oauth-python-twitter to create an evolved OAuth Pokemon.
python-twitter by DeWitt Clinton. This library provides a pure Python interface for the Twitter API.
python-twyt by Andrew Price. BSD licensed Twitter API interface library and command line client.
twitty-twister by Dustin Sallings. A Twisted interface to Twitter.
twython by Ryan McGrath. REST and Search library inspired by python-twitter.
Tweepy by Josh Roesslein. Supports OAuth, Search API, Streaming API.
My requirements are fairly simple:
Be able to use OAuth
Be able to follow a user
Be able to send a direct message
Be able to post
Streaming API would be nice
Twisted one aside (I'm not using twisted in this case), have you used any of the others, and if so, do you recommend them?
[Update] FWIW, I ended up going with Python Twitter Tools again. The new version supported OAuth nicely, and it's a very clever API, so I stuck to it.
python-twitter should cover the first four requirements. I've used it before, and it's fairly easy to start developing with it. For leveraging Twitter's streaming API, I would recommend tweetstream. It's a fantastic Python module that grabs tweets in real-time as they are posted. Based on whether you have gardenhose/firehose access to the twitter stream, you'll only get a small fraction of tweets posted. With tweetstream, you can also provide a list of search predicates to filter specific tweets that you are looking for. I used it for a project that involved mining tweets over an 8 hour period and it worked flawlessly. Both of these modules should be available through Python's easy-install.
EDIT: I don't know what you intend on doing with Python/Twitter but if you do plan on capturing a lot of tweets, keep in mind that Twitter receives myriad tweets in languages besides English. Remember to encode everything properly.
Full disclosure: I'm the author of Twython.
As such, I'd recommend using mine. It supports OAuth now, and ships with a skeleton Django application to get you up and running in ~5 minutes.
It can handle everything you're looking for, sans the Streaming API - I'm of the opinion that something like that should be implemented on a case-by-case basis, as it's generally a fairly custom setup. There's been very little demand for library support for it, either, so I've a hard time dedicating cycles to supporting it.
pip install twython
http://github.com/ryanmcgrath/twython
I've used tweepy for playing around and thought it was pretty easy and fun to use. Didn't really look that much into the alternatives however so take my opinion with suitable amount of salt :).
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I did the courses for HTML/CSS/JS/jQuery/Python on Codecademy and since then I've been practicing client side programming with HTML/CSS/JS/jQuery following documentation an tutorials using Notepad++ and Chrome.
I decided that it was time to start practicing server-side programming, so that I could integrate client side programming into a fully functional website. So, I asked on Yahoo Answers for the best way to practice server-side programming, and from the answers it seems that the best way is just to set up one of my old PCs as a server. The same guy also told me that PostgreSQL is not useable ('very few real servers will allow it'), that Apache is meant for PHP/MySQL, and that Python isn't used with HTML.
He said that I needed to relearn, so I am rather confused right now. I figured that Python/Ruby/PERL etc. were interchangeable with PHP, and were just different ways of doing the same thing? The same with PostgreSQL, it seemed to me that it was interchangeable with MySQL? I've not even used Python yet (aside from on Codecademy) as I haven't figured out how to use it, but I was really keen on using it for web development.
from the answers it seems that the best way is just to set up one of my old PC's as a server
For the love of $DEITY, please do not do that. If you are just starting out, you do NOT want to have learn server management, installing various tools from the ground up (SSH, FTP, Apache, MySQL, etc), setting up router and static IP address, setting up firewall/iptables, setting up domain names, etc, etc, etc all at the same time. Learning all that at the same time will be too overwhelming.
I'd suggest using a good shared hosting to reduce pain.
PostgreSQL is not useable ('very few real servers will allow it'?); that Apache is meant for PHP/MySQL; and that Python isn't used with html
Whoever told you that is totally clueless. While PostgreSQL is less popular than MySQL, most of the serious web hosting supports it; Apache is one of the most flexible web servers, it supports a very wide range of web technologies, not just mod_php; and the claim that Python is not used with HTML is an obvious untruth.
You will find guidance about all of these things on the Django website, apart from installing linux and setting up your own server box.
Please ignore that Yahoo answer.
Django supports many different database servers and is officially supported with PostgreSQL, MySQL, Oracle and SQLite.
https://docs.djangoproject.com/en/1.4/topics/install/#get-your-database-running
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am about to start a new personal web / iphone app project which requries the following:
Storing data on the backend
authenticating the user via openid
Generate JSON based APIs for reading and writing data
I normally use Django for all of my projects but thought I would take this opportunity to learn something new. So, are their any Python based web development frameworks that are good alternatives to Django? Ideally ones that are strong on the points listed above?
Bonus points if the framework is:
lightweight
easy to install, deploy and developwith
Any recommendations?
I've only ever used Django and I love it, but here's a couple others (I think Flask is your best bet for a very small and very lightweight web app)
Flask
"Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions."
- http://flask.pocoo.org/
Pylons
"Rather than focusing on a single web framework, the Pylons Project will develop a collection of related technologies. The first package from the Pylons Project was the Pyramid web framework. Other packages have been added to the collection over time, including higher-level components and applications. We hope to evolve the project into an ecosystem of well-tested, well-documented components which interoperate easily." - http://www.pylonsproject.org/
Grok
"Grok is a web application framework for Python developers. It is aimed at both beginners and very experienced web developers. Grok has an emphasis on agile development. Grok is easy and powerful." - http://grok.zope.org/
TurboGears
"TurboGears will help you to create a database-driven, ready-to-extend application in minutes. All with code that is as natural as writing a function, designer friendly templates, easy AJAX on the browser side and on the server side and with an incredibly powerful and flexible Object Relational Mapper (ORM)." - http://www.turbogears.org/
More Python Framework Resources
After a little more digging I found this resource: http://wiki.python.org/moin/WebFrameworks/
I've used web2py for a couple small projects and really liked it.
It is pretty lightweight, has great documentation, and in my experience very simple to deploy.
I've never used Django, so I'm not sure how it compares.
A few hello worlds:
def hello1():
return "Hello World"
def hello5():
return HTML(BODY(H1(T('Hello World'),_style="color: red;"))).xml() # .xml to serialize
def hello3():
return dict(message=T("Hello World"))
The corresponding view for hello3:
{{extend 'layout.html'}}
<h1>{{=message}}</h1>
Use web.py can be found at http://webpy.org/ Very simple URL handling and lots of built in functionality but still light weight
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.
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/
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...
It depends what you are trying to do. I had the same problem and ended up using django-social-auth , which lets you log in via Facebook and many other social networks.It also lets you extract the token from those networks and then use it.
For the facebook specific stuff, I use facebook-sdk, but since you have something managing the tokens, you could really replace it with any library if yours become outdated in upcoming years . It also means you can add more social networks later on.
I'm looking for a Payment gateway that offers Python SDK which would run on GAE. So far I've looked at Braintree[1] and TrustCommerce[2], and both required C-based libraries to work, which won't work on GAE. If there's no such thing, which payment gateway would you recommend that provides a possibly JSON-based API or a nice RESTful API.
[1] http://www.braintreepayments.com/
[2] http://www.trustcommerce.com/
Braintree uses PycURL library which is C-based
TrustCommerce comes with some C files that need to be compiled during install
EDIT:
I'll vote close on this, because it's been suggested that such thing is impossible because URLfetch has a 10 second limit which is not sufficient in this case. For those interested, it has been suggested to me that using a proxy for payment processing would be better.
It would be really helpful if you provided links. I googled and found this TrustCommerce, but I guess maybe it's a different company to the one you are talking about because they say there is sample Python code.
I didn't sign up for a trial account just to see if the Python API requires a C library. Afterall maybe it's not even the same TrustCommerce you have looked at.
This isn't really the right site to do your research, you should come back and ask for help if you have problems using the API when you have found/chosen one.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Looking to do a very small, quick 'n dirty side project. I like the fact that the Google App Engine is running on Python with Django built right in - gives me an excuse to try that platform... but my question is this:
Has anyone made use of the app engine for anything other than a toy problem? I see some good example apps out there, so I would assume this is good enough for the real deal, but wanted to get some feedback.
Any other success/failure notes would be great.
I have tried app engine for my small quake watch application
http://quakewatch.appspot.com/
My purpose was to see the capabilities of app engine, so here are the main points:
it doesn't come by default with Django, it has its own web framework which is pythonic has URL dispatcher like Django and it uses Django templates
So if you have Django exp. you will find it easy to use
But you can use any pure python framework and Django can be easily added see
http://code.google.com/appengine/articles/django.html
google-app-engine-django (http://code.google.com/p/google-app-engine-django/) project is excellent and works almost like working on a Django project
You can not execute any long running process on server, what you do is reply to request and which should be quick otherwise appengine will kill it
So if your app needs lots of backend processing appengine is not the best way
otherwise you will have to do processing on a server of your own
My quakewatch app has a subscription feature, it means I had to email latest quakes as they happend, but I can not run a background process in app engine to monitor new quakes
solution here is to use a third part service like pingablity.com which can connect to one of your page and which executes the subscription emailer
but here also you will have to take care that you don't spend much time here
or break task into several pieces
It provides Django like modeling capabilities but backend is totally different but for a new project it should not matter.
But overall I think it is excellent for creating apps which do not need lot of background processing.
Edit:
Now task queues can be used for running batch processing or scheduled tasks
Edit:
after working/creating a real application on GAE for a year, now my opnion is that unless you are making a application which needs to scale to million and million of users, don't use GAE. Maintaining and doing trivial tasks in GAE is a headache due to distributed nature, to avoid deadline exceeded errors, count entities or do complex queries requires complex code, so small complex application should stick to LAMP.
Edit:
Models should be specially designed considering all the transactions you wish to have in future, because entities only in same entity group can be used in a transaction and it makes the process of updating two different groups a nightmare e.g. transfer money from user1 to user2 in transaction is impossible unless they are in same entity group, but making them same entity group may not be best for frequent update purposes....
read this http://blog.notdot.net/2009/9/Distributed-Transactions-on-App-Engine
I am using GAE to host several high-traffic applications. Like on the order of 50-100 req/sec. It is great, I can't recommend it enough.
My previous experience with web development was with Ruby (Rails/Merb). Learning Python was easy. I didn't mess with Django or Pylons or any other framework, just started from the GAE examples and built what I needed out of the basic webapp libraries that are provided.
If you're used to the flexibility of SQL the datastore can take some getting used to. Nothing too traumatic! The biggest adjustment is moving away from JOINs. You have to shed the idea that normalizing is crucial.
Ben
One of the compelling reasons I have come across for using Google App Engine is its integration with Google Apps for your domain. Essentially it allows you to create custom, managed web applications that are restricted to the (controlled) logins of your domain.
Most of my experience with this code was building a simple time/task tracking application. The template engine was simple and yet made a multi-page application very approachable. The login/user awareness api is similarly useful. I was able to make a public page/private page paradigm without too much issue. (a user would log in to see the private pages. An anonymous user was only shown the public page.)
I was just getting into the datastore portion of the project when I got pulled away for "real work".
I was able to accomplish a lot (it still is not done yet) in a very little amount of time. Since I had never used Python before, this was particularly pleasant (both because it was a new language for me, and also because the development was still fast despite the new language). I ran into very little that led me to believe that I wouldn't be able to accomplish my task. Instead I have a fairly positive impression of the functionality and features.
That is my experience with it. Perhaps it doesn't represent more than an unfinished toy project, but it does represent an informed trial of the platform, and I hope that helps.
The "App Engine running Django" idea is a bit misleading. App Engine replaces the entire Django model layer so be prepared to spend some time getting acclimated with App Engine's datastore which requires a different way of modeling and thinking about data.
I used GAE to build http://www.muspy.com
It's a bit more than a toy project but not overly complex either. I still depend on a few issues to be addressed by Google, but overall developing the website was an enjoyable experience.
If you don't want to deal with hosting issues, server administration, etc, I can definitely recommend it. Especially if you already know Python and Django.
I think App Engine is pretty cool for small projects at this point. There's a lot to be said for never having to worry about hosting. The API also pushes you in the direction of building scalable apps, which is good practice.
app-engine-patch is a good layer between Django and App Engine, enabling the use of the auth app and more.
Google have promised an SLA and pricing model by the end of 2008.
Requests must complete in 10 seconds, sub-requests to web services required to complete in 5 seconds. This forces you to design a fast, lightweight application, off-loading serious processing to other platforms (e.g. a hosted service or an EC2 instance).
More languages are coming soon! Google won't say which though :-). My money's on Java next.
This question has been fully answered. Which is good.
But one thing perhaps is worth mentioning.
The google app engine has a plugin for the eclipse ide which is a joy to work with.
If you already do your development with eclipse you are going to be so happy about that.
To deploy on the google app engine's web site all I need to do is click one little button - with the airplane logo - super.
Take a look the the sql game, it is very stable and actually pushed traffic limits at one point so that it was getting throttled by Google. I have seen nothing but good news about App Engine, other than hosting you app on servers someone else controls completely.
I used GAE to build a simple application which accepts some parameters, formats and send email. It was extremely simple and fast. I also made some performance benchmarks on the GAE datastore and memcache services (http://dbaspects.blogspot.com/2010/01/memcache-vs-datastore-on-google-app.html ). It is not that fast. My opinion is that GAE is serious platform which enforce certain methodology. I think it will evolve to the truly scalable platform, where bad practices simply not allowed.
I used GAE for my flash gaming site, Bearded Games. GAE is a great platform. I used Django templates which are so much easier than the old days of PHP. It comes with a great admin panel, and gives you really good logs. The datastore is different than a database like MySQL, but it's much easier to work with. Building the site was easy and straightforward and they have lots of helpful advice on the site.
I used GAE and Django to build a Facebook application. I used http://code.google.com/p/app-engine-patch as my starting point as it has Django 1.1 support. I didn't try to use any of the manage.py commands because I assumed they wouldn't work, but I didn't even look into it. The application had three models and also used pyfacebook, but that was the extent of the complexity. I'm in the process of building a much more complicated application which I'm starting to blog about on http://brianyamabe.com.