By Forrest Cook
December 2, 2009
Pyspread
is a spreadsheet program with the unusual capability of supporting
Python syntax within its cells:
Pyspread is a cross-platform Python spreadsheet application. It is based on and written in the programming language Python.
Instead of spreadsheet formulas, Python expressions are entered into the spreadsheet cells. Each expression returns a Python object that can be accessed from other cells. These objects can represent anything including lists or matrices.
The Pyspread feature list includes:
- Released under the GPLv3 license.
- Designed for cross-platform operation.
- Individual cells can hold a Python expression.
- Cells return Python objects such as lists and matrices.
- Cells can access all of the available Python modules.
- The cell grid can be three dimensional.
- Unicode characters are supported.
- Pyspread can import and export comma separated value (CSV) lists.
- Statistics and plotting functions are available through RPy.
Pyspread version 0.0.12a was
announced
on November 21, 2009 by developer Martin Manns;
it added some new functionality and included some bug fixes.
The software is still in an early state of development:
"Pyspread is currently in the Alpha stage. Feel free to try it out on your own risk. Toy with it. Send me lots of bug reports, feedback, suggestions and improvements."
Your author tried a test installation of Pyspread on an Ubuntu 9.10
system.
The version 0.0.12a .zip file was downloaded and, unzipped.
The installation instructions in the INSTALL file said to
run python setup.py install as root. This was done and
pyspread was installed in /usr/local/bin/.
Pyspread was run with the command pyspread and produced the
error: No module named wx. The project's SourceForge
main page
had more information on the required packages:
"In case you do not have it already get and install Python, wxpython and numpy.
If you want the examples to work, install gmpy, R and rpy."
The required Ubuntu packages were named python-wxgtk2.8 and
python-numpy. After installing the dependencies, Pyspread started
successfully.
On the surface, Pyspread operation is similar to that of other spreadsheets, with
the exception that the cells can contain the much more powerful
Python expressions.
The
screenshot gives an example of the user interface.
The
Tutorial
is the first place to go to learn how to use Pyspread, the
FAQ may help to answer more obscure
questions about the software. A few basic tutorial examples
were tried and the software behaved as one would expect.
One issue that caused your author some confusion was that cells were
labeled [X, Y, Z] but X was the position within the columns and Y was the position within the rows. From the Tutorial:
"Each cell can access its own position in the grid through the magic variables X (row), Y (column) and Z (table)."
The documentation is quite
sparse at this point in the software's evolution, it could
be improved by including basic spreadsheet examples such as how to
calculate the sum of a row and/or column of numbers.
One could imagine that it would take a document the size of a book
to cover the software's full capabilities.
Some interesting questions can be raised when using a general purpose
language such as Python to calculate the cell values in a spreadhseet.
Could the cells be filled with values produced by a USB-connected
sensor or pulled from an external web page? Could the output of a cell
be sent somewhere across the network?
Could it encroach on the turf of commercial software such as
PV-WAVE?
And of course, what are the security
implications of all of this? Pyspread should be an interesting
application to watch as it matures.
(
Log in to post comments)