Python Code Completion
April 9, 2008 by kapilt
Working with large code bases like Zope and Plone can quickly give your hands a workout. I’ve been looking around for some good python completion tools that i can use directly from textmate or emacs.
the critical comparison test for any such tools.
- works well with large codebases.
- opensource
ctags/gtags
not directly related to completion, but exuberant tags / ctags gives the ability to lookup symbol (classes, methods, functions) definitions, and jump around a code base is incredibly useful. conceivably you could build a usable completion tool directly from a ctags file, that did symbol completion rather than context aware completion.
http://ctags.sourceforge.net/
gtags, a variant from google, sets up source with a client/server index, and is more appropriate for a symbol completion scenario.
rope
http://rope.sourceforge.net
a re-factoring library. lots of unit tests. editing centric api is a bit of challenge to use for the lightweight integration i’m looking for.
KomodoEdit
was recently open-sourced. Komodo is a pretty nice dynamic language ide with supprot for ruby/perl/python/xslt and more. Some of the more critical features for an IDE were unfortunately not included in the opensourcing, like a debugger. it does however have a very nice cross language code intelligence system (codeintel package), based on static analysis. which with a little bit of effort could be made into a nice library for use any ide.
http://www.openkomodo.com/
PyDev
the eclipse plugins seems to utilize a dynamic inspection in a separate thread with a socket interface for driving the system via the GUI. the technique at least easily ported to other environments, although i cringe at the notion of random code execution by such a tool.



I’m using Komodo Edit for a lot of the work I do. I used to use the pay version of Komodo (Personal Edition) before they bumped up the price significantly (and moved most of what was in Personal Edition to Komodo Edit).