ano.malo.us pretty typical actually..

Giving Props

Over the last couple of weeks, I’ve used some great open-source (mostly python) tools. Here’s some pagerank-improving props:

I borked up my python installation in a 4AM egg-deleting frenzy so I installed Python 2.5 and re-installed all packages. Without easy_install and the Cheeseshop, this would have been a tedious nightmare. I’ve loved this kind of package management since the first time I did an ‘apt-get install gnome’ (Yes, I used CPAN before apt-get
but only minimally (the punctuations made my eyes hurt)).

I decided to rewrite a Turbogears webapp in Pylons. I like TG and am still using it for another project but the upcoming TG2 release seem to have a lot of non-backwards-compatible changes and so I’m waiting for that… and I wanted to check out Pylons. It’s similar to TG and I was able to copy most of the code directly. It’s nice having the flexibility to copy over the old templates with minimal changes (thanks to Genshi) and even though I haven’t had the opportunity to use them much, the webhelpers package looks really awesome. I’m also diggin this whole WSGI and paste stuff — don’t understand most of the details but enough to get it working and see its larger potential.

SQLAlchemy is easy enough to use and lets me be relational while still being hip with the ORM kids and Elixir makes creating SA models dead simple. Their DSL-magic happens thanks to what they call Statements, classes that add themselves into the containing class’ dict. This little bit of python black magic let’s you write stuff like:

class Widget:
   has_field('name')
   has_field('type')
   belongs_to('machine')

In the above example, has_field and belongs_to modify the Widget class without having a reference to it by getting the reference via sys._getframe. Hackish and beautiful.

CocoaDialog lets you create little mac GUI widgets (progress bar, file chooser, dialog boxes, etc) on the command line, passing all params via command line arguments and interacting via stdin and stdout. This has been my way of getting a little mac GUI goodness without learning Objective-C and all the Cocoa libs.

And finally, py2app let’s you stuff a Python interpreter, standard libs and any packages and modules you use into a Mac Application bundle so users can run your code just like any other mac app without having to worry about python or any dependencies. They get a native-looking app and I get python.

I’ve been working on a project that would’ve taken about 2 years to develop instead of 2 weeks had I not had the benefit of all these tools. Standing on the shoulders of giants, indeed!


No Comments Yet


Leave a Comment

Negative Zero Considered harmful considered overused