Last 5 Posts from 2006/January/16

TurboGears rules!

These days I checked out TurboGears, a Python rapid web development megaframework. It bases on well-known projects like CherryPy and SQLObject together with new components like Kid Template and Mochikit JavaScript Library to provide you a powerful platform to develop your web projects. I really enjoyed it!

Once web development for python was all Zope and Plone related. However these technologies have a big learning curve that makes beginners uncomfortable, unlike Python, that makes user life easy from beginning yet providing power to experienced users. I'm an experienced python programmer and already did Perl/CGI and PHP programming for years, but could not learn Zope or Plone in one afternoon. As I'm not a professional web developer, I don't want to spend more than one afternoon just to learn the framework basics!

Then various frameworks came, most of them were incomplete in some sense and they were all incompatible, most of them have great features but some limitations or design goals that made me avoid them.

I don't know if it were due to Ruby on Rails success or if the python community agreed in a coincident timeframe, but this last year two pupils were born: DJango and TurboGears. Both are really well documented and have useful tutorials and screencasts. The first were born from inside a web-publish site and have really great administrative features, however it does not extensively use other projects: it have it own Object-Relationa-Map, template system and more. The last doesn't have so many ready-to-use tools yet (version 0.8), but by using existing tools like SQLObject and CherryPy it's evolving really fast and have promising features to come in version 0.9. That's why I opted for TurboGears.

TurboGears allows you to develop a MVC web applications, you just need to code your views using Kid or other template plugin (0.9 will ship with others, like Cheetah), code your controllers with methods that should be accessible from web-server being exposed and your models using sqlobject. It's so versatile that you may use most of your controller methods to return not just HTML/XML but also JSON (without changing the source code!) that, associated with Mochikit, makes it extremely easy to code dynamic HTML like AJAX interfaces together with plain HTML!

Version 0.9 also includes:

Identity system
handles permissions and authentication
CatWalk
General model browser and editing system
ModelDesinger
Design your SQLObjects in a visual, WYSIWYG fashion
Widgets
Avoid writing forms manually. This handles validation and presentation to you!
It's a great framework, but it's a bit unstable until 1.0 comes. I plan to publish some examples as soon as I have them :-)

Heading to LinuxConf.AU!

This week will be a great week. Thursday and Friday I'll have party because I've graduated at University, most of my family members and friends will join me and it must be cool! Then, on Saturday afternoon I leave Brazil heading to Dunedin, New Zealand, to participate at LinuxConf.AU, where I'll present a talk on Wednesday and watch other cool presentations by great people, like Aaron Seigo, Andrew Tridgell, Keith Packard, Rusty Russell and others! I never thought I would met them! :-)

Eagle: easy GUI using python

Remember my post Crap code of the moment: libgip (and how to make it better)? I implemented most of things I listed in my post, did some tutorials and documentation.

After that post I started to wonder how difficult was to code a basic prototype and I thought it was easy, so in about 4 hours I coded a basic abstraction using Python and GTK+2. It was just a GtkWindow with 5 areas (combination of GtkHBox and GtkVBox) and a few widgets.

Then I started to play with it and after writing some documentation and the tutorial I added more interesting stuff. Some required stuff is still missing, like a "grid" (a.k.a. GtkTextView, QListView, ...), automatic thread support, menu and toolbars.

Now it's reasonable mature and has even an entry at Python Package Index: http://www.python.org/pypi/eagle/ and also a home page at http://www.gustavobarbieri.com.br/eagle/. Code repository is at http://code.gustavobarbieri.com.br/eagle (it uses SVN).

Remember: Ealge is not meant to be "yet another" toolkit, instead it build atop existing toolkits adding features and some restrictions to help you to develop your applications. Narrowing the scope of what can be done with this library, things could be made easier to its users, like the automatic layout in one of the 5 areas and the label at right of user entry components.