Python
Python FoursquareV2 library
0At Fondu, location-based services, specifically foursquare, are incredibly important to us. Location with a social context is at the core of just about everything in our product.
When we originally migrated from PHP to Python, the offering of foursquare Python libraries was really lacking in terms of polish. So rather than bitch about it, we rolled our own. The goal was simple, Pythonic, and following the official API one-to-one. Full unit tests can't hurt either.
Naveen and the foursquare crew have been great to us as developers, so we'd like to give back by releasing our library. Check it out if you'd like a nicely-maintained foursquare Python library. As of this blog post I think it's the only up-to-date one that I could find.
The source is at https://github.com/mLewisLogic/foursquare
It's new, but it's already being used in a few projects, some in production. Let me know if there are improvements you'd like to see in it.
How to install Python Imaging (PIL) in a virtualenv with –no-site-packages
2This gets PIL working with JPEG/ZLIB support within a virtualenv (with –no-site-packages). This has specifically been tested with Python 2.7 on Ubuntu 11.04.
1. Install the dependencies needed for the PIL library, using aptitude. This installs everything but PIL itself.
sudo apt-get build-dep python-imaging
2. Install the python-dev package so that we can compile PIL.
sudo apt-get install python-dev
3. Make sure that PIL's setup.py can find JPEG/ZLIB, by supplying a settings override file. Ubuntu installs these libs in a non-standard place, so we need to let the package's installer know where to find them. Create a file named setup_site.py in the root of your virtualenv (or somewhere in your path) with the following contents:
JPEG_ROOT = ('/usr/lib/i386-linux-gnu/', '/usr/lib/x86_64-linux-gnu/')
ZLIB_ROOT = ('/usr/lib/i386-linux-gnu/', '/usr/lib/x86_64-linux-gnu/')
FREETYPE_ROOT = ('/usr/lib/i386-linux-gnu/', '/usr/lib/x86_64-linux-gnu/')
4. From the root of your virtualenv (with it activated) run:
pip install PIL
That's it! If you run into any problems on Ubuntu 11.04+, leave a comment and I'll try to update the post accordingly.