wiki:Vanilla

Vanilla is a Python wrapper around Cocoa. It was inspired by the classic W Python library.

The advantage of Vanilla is that it provides a very simple, familiar API for Cocoa. The disadvantage is that it doesn't use NIB files; you specify the interface programatically. There are tradeoffs either way. I personally prefer the simpler API over the niceties of InterfaceBuilder.

It should be noted that the API, while stable for the most part, is still under development. SplitView, SegmentedButton and LevelIndicator are still experimental.

There are lots of examples in the documentation. Here is a simple one showing how to make a window with a list.

import vanilla

class Demo(object):

    def __init__(self):
        self.w = vanilla.Window((200, 300), "Demo")
        self.w.list = vanilla.List((15, 15, -15, -15), ["A", "B", "C"], selectionCallback=self.selection)
        self.w.open()

    def selection(self, sender):
        print "selection:"
        for index in sender.getSelection():
            print sender[index]

Dependencies

Source Code

The source code can be browsed here. Or, you can check it out with Subversion at  http://svn.typesupply.com/packages/vanilla.