I’ve started a new open source project called Jester. Jester is a rules engine for points and badges, also known as Gamification.
Jester is written in Python, using Redis for storage.
I’ve created a tiny Domain Specific Language for defining rules using the pyparsing library.
A couple examples of rules:
create rule on game_play award 5 points create rule on game_play award badge game_addict when game_play occurs 5 times in 1 day This project is in the very early stages and is not yet functional as of this posting.
python
- I ran into an issue installing the MySQLdb module. >>> import MySQLdb /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Python/2.7/site-packages/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg/_mysql.pyc, but /Users/jhaddad/Downloads/MySQL-python-1.2.3 is being added to sys.path Traceback (most recent call last): File "", line 1, in File "MySQLdb/__init__.py", line 19, in import _mysql File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 7, in File "build/bdist.macosx-10.7-intel/egg/_mysql.py", line 6, in __bootstrap__ ImportError: dlopen(/var/root/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib Referenced from: /var/root/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so Reason: image not found I fixed it by doing the following:
- easy_install on the mac has some weird hardcoding issue where it uses a specific version of setuptools. You can read a really good explanation by Andreas Jacobsen here. The fix is to use python to call easy_install instead of using the Apple provided one. sudo python -m easy_install pymongo
- I tried Python out a while ago, but stopped trying it to learn it after some major frustrations. Maybe I didn’t dig deep enough into it. I found the documentation hard to read, and the module layout seemed a little random at times. For some reason I found executing an external process and getting the results to be a little convoluted. (Since then I’ve learned to use popen(..).communicate()) I ended up messing with other languages to try to find one that suits my tastes, like Erlang and D.
- I’ve been trying to get into Python in my spare time, since it’s got such a huge volume of modules and looks like it should be easy to be ripping it up in no time. But of course, I have my complaints. Fortunately I don’t need to write a long blog post, this guy did it for me. It’s kind of alarming this post is from 2 years ago and the docs are still a major problem.
- I found a good tutorial on IBM on doing Python development with Eclipse. It might be a little out of date, but I think only the screens got moved around a little bit. It includes details on how to use ant, which I’ve recently started using with cruise control and PHP, so I’m becoming a fan. I did run into an issue where I’d get the error ‘Variable references empty selection: ${project_loc}”, but a quick google brought me to a solution here.
- I finally found the manual for PyTables. In case anyone else is as blind as I am, I’m linking to it here.
- NumPy is a requirement to work with PyTables. This is the second step in the install process, after getting HDF5 set up. These instructions are based on the ones found on the NumPy site, but I’m summarizing things for my own use later on. First, you’ll need to install the Fortran compiler for OSX (gFortran). Fortunately there’s a Fortran universal binary installer. Next, get the NumPy source. You can find it on Sourceforge.
- I’m trying to evaluate pytables as a replacement for very large Python dictionaries, but having some issues getting HDF5 installed on my Mac (OS X Snow Leopard). I’ve been getting this error: configure: error: C compiler cannot create executables I haven’t been able to figure out what’s wrong yet - anyone have any ideas? I’ve got XCode Tools installed, I’ve compiled Apache, PHP and Memcached without issue (prior to Snow Leopard Update).
- There’s a weird behavior in Python when dealing with Mutable types such as dictionaries, that when you modify a variable defined as a class attribute, you’re actually modifying a shared dictionary amongst all the classes. This seemed weird to me. You can read the lovely discussion about it, if you want. Or, just follow my code for a demo on how to deal with the issue. I just started Python on Monday night, so please overlook my n00bness.