November 23, 2011

Python+Heroku: Minecraft Enchant Calculator


Yesterday, someone on the minecraft subreddit posted their .NET/Windows-based enchantment calculator. I don't run Windows at home, so I couldn't check it out, but I thought it sounded like a lot of overhead for such a simple tool, and something that could function well as a small web application.

It was also a good excuse to try out Flask on Heroku. I've been meaning to start with the former on something non-database-backed, and as for the latter, they're free and good and have newly-minted python support, so what's not to like?

What I learned

  • Flask is a very nice replacement for making low-overhead experiments that I might otherwise be tempted to do in PHP for simplicity of deployment.
  • Heroku is awesome.
  • Don't skip over the easy-sounding bits of the Heroku documentation.

I got my Heroku instructions from their devcenter, and followed them closely. They even provided almost enough Flask example to get going. If you want to do something similar, I recommend going there.

I could put code docs in here, but I think the docstrings and comments do a good job. Check out the code!