Generate a Python API catalog

Posted by toddw on 2010-11-05 11:12
Question: 

How do I generate a Komodo API catalog for Python binary module(s)?

Answer: 

Here are the steps you can use to generate a Komodo CIX file for a Python module:

  • Install your Python modules
    You'll need to have both Python and the Python modules installed on your computer.
  • Checkout the Komodo gencix tools
    # Argh, the website is formatting the URL below, you will need
    # to manually copy/update the URL link from below
    svn co http://svn.openkomodo.com/repos/openkomodo/trunk/src/codeintel/support/gencix/python python_gencix
    cd python_gencix
  • Generate the base cix file
    This is an example to generate the cix for the Python "socket" module:
    python gencix.py --onefile=socket.cix --name="Socket" --description="Python socket module" socket
  • Tweak the cix
    You may need to tweak the cix file, adding/removing/updating certain elements as you see fit.
  • Add the API to Komodo
    You can then add this API catalog (through Komodo's Codeintel preferences) into Komodo.

Cheers,
Todd

cpetz | Mon, 2013-04-15 22:38

I now understand why it took me so long to find more API Catalogs for python. I have a few suggestions that I believe would really round off this great tool.

I still have not really dug into source, or even the CIX XML for that matter, so maybe these are simple suggestions, maybe not. But from functional point of few they make a lot of sense I think. Just a few wrapper scripts seems like it could do the job.

1) Help me convert a Tag (CTags for example) file into some type of primitive CIX. I know it may not harness the full power of CIX, but maybe thats not a bad thing either (less is more after all). At least help me migrate it some way that generates a valid CIX that I can then begin to work on by hand.

2) When first converting groups of modules, I like to split them up into smaller groups so they are easier to edit (CIX outfiles). But then I get to a point where I have import 30 catalogs into Komodo. We need a merge tool that know how to combine smaller files into one big file, without breaking any of the manual edits that were made.

3) This last one is off topic a bit, but I think a great extension would be a CodeIntel *tree*, to visually display a module and break out as much of the collected docs as is reasonable. Polish it up pretty nice and it would be a tremendous asset when breaking into large API's, rather than jumping back and forth between your browser and Komodo. (I just tore into SqlAlchemy for the first time. I ended up with 15 tabs on my browser and 2 paper printed manuals, and I still kept having to constantly look things up. Having a little CodeIntel package browser would have made my day, not to mention the calltips.)