Programming Gnumeric using Python

A powerful way to access and manipulate data in Gnumeric involves using the Python programming language. As Gnumeric develops from version 1.2, the scripting methods will become increasingly powerful. Since Gnumeric is free software, you could extend it directly using the source code and adding C language functions to the code. Python offers a higher level abstraction through which to interact with the spreadsheet.

Python and Gnumeric can be used in several ways. This section will describe how to obtain Gnumeric, install it and get things configured correctly for access with Python. If you already have the pieces in place, you can skip the section Section 18.3.1 ― Installing and Building Gnumeric for Python.

This section was written by Charles Twardy. It owes a great deal to the nice guide Travis Whitton wrote: Python/Gnumeric guide for the old API in Gnumeric 1.0. Jon Käre Hellan contributed most of the code to enable Python in Gnumeric and wrote the file python-gnumeric.txt in the source tree. Nathan Hurst provided the idea and support.

The Python API, that is the list of methods available in Python, is still experimental and may change!

For further information, the web page maintained by Jon Käre Hellan's has some python plugins and other useful information. That page can be found through this link. The main Gnumeric page may also have useful information.

If you need help online, you may want to check out:

  • The Gnumeric Function-Writer's Guide. Until I write one for Python, you'll have to settle for doc/developer/writing-functions.sgml in the Gnumeric source tree.
  • The files that actually define the Python interface. In particular, plugins/python-loader/py-gnumeric.c has good comments at the beginning.
  • The instructions on how to use GNOME Git can be found here.
  • The gnumeric discussion list: <gnumeric-list@gnome.org>
  • The IRC channel #gnumeric on the GIMPnet server. Right now, the project leader is Jody Goldberg (jody) and the Debianizer is: J.H.M. Dassen (jhm). Jody, Jon K. Hellan, and Zbigniew Chyla appear prominently in the Python ChangeLog.