Using Mochi API with python

Last Update: 27.12.2009. By azarai in python

For a new project of mine i needed to get the game data from mochimedia. As they provide an useful api i searched for an existing and easy to use solution, but besides django-arcade, a full arcade site, i didn’t find anything. As the design of django arcade did not fit my needs, i rolled my own. So python mochi was born.

My main focus was to use the autopost feature and reading the json format. Handling of the actual http request is not part of the mopdule as i wanted to keep it web framework independent. And error handling might not be optimal :-)

from mochi.autopost import fetch_game

PUBLISHER_ID = 'your publisher id'    
game_tag= '18c4fc4b1b391f11'    
filestore = '.'

game = fetch_game(PUBLISHER_ID, game_tag, filestore)
print 'downloaded game %s ' % game.slug

Project site:
python mochi.

Want content like this in your inbox each workday irregularly? No BS, spam or tricks... just useful content:

I understand and agree to the privacy policy