ANN: pyspread 0.0.8

M

mmanns

pyspread 0.0.8 has been released.

About:
pyspread is a spreadsheet that accepts a pure python expression in
each cell.

New features:
New macro dialog that allows defining python functions, which can be
used in the grid.
Bug fixes within the copy paste and print code.

Highlights:
+ Numpy high performance arrays for spreadsheet calculation
+ Full access to python batteries from each cell
+ No non-python syntax add-ons
+ 3D grid
+ Cell access via slicing of numpy array S
+ X, Y, and Z yield current cell location for relative reference

Requires: Python >=2.4, Numpy 1.0.4, and wxPython 2.8.7.1.
License: GPL

Project page: http://pyspread.sourceforge.net

As always, feedback is appreciated.
Please also test with wxPython 2.8.8.0.

Enjoy

Martin
 
C

Colin J. Williams

pyspread 0.0.8 has been released.

About:
pyspread is a spreadsheet that accepts a pure python expression in
each cell.

New features:
New macro dialog that allows defining python functions, which can be
used in the grid.
Bug fixes within the copy paste and print code.

Highlights:
+ Numpy high performance arrays for spreadsheet calculation
+ Full access to python batteries from each cell
+ No non-python syntax add-ons
+ 3D grid
+ Cell access via slicing of numpy array S
+ X, Y, and Z yield current cell location for relative reference

Requires: Python >=2.4, Numpy 1.0.4, and wxPython 2.8.7.1.
License: GPL

Project page: http://pyspread.sourceforge.net

As always, feedback is appreciated.
Please also test with wxPython 2.8.8.0.

Enjoy

Martin
Are you planning any documentation?

I've tried:
# tpySpread.py
print 'start'
import pyspread
print pyspread.__doc__

Colin W.
 
M

mmanns

Are you planning any documentation?

Actually, yes.
0.0.10 will feature some docs.
Any help writing and doing the layout is highly appreciated ;-)
I've tried:
# tpySpread.py
print 'start'
import pyspread
print pyspread.__doc__

Just launch it with

$ pyspread.py

or when in Windows double click on the pyspread.py file in the Scripts
folder that is in your Python folder.

Alternatively, when in python type:

Then the main window should come up.

To make things easier, I post a preliminary tutorial:


--- Tutorial ---

1) One python expression per cell.

In the top left cell (row 0, column 0, table 0) type:
2 + 2 <Enter>

The cell text changes to:
4
which is the string representation of the result.

Select the top left cell again. 2 + 2 is displayed in the text field
above the grid. Double-clicking on the cell also changes the content
back to 2 + 2.

From any other cell, the cell result (that is the resulting object) can
be accessed by entering
S[0, 0, 0]

This is also possible for other tables. Change to Table 1 in the
icon bar choicebox. and enter S[0,0,0] somewhere.

A value can also be assigned to a global variable. Change back to Table
0 and type into cell 1,0,0:
myfancystring = " ".join(str(i) for i in xrange(100))

myfancystring can now be accessed from any other cell as a global
variable.

In each cell, upper case X, Y, and Z refer to the cell's position in
the grid. So if you type into the cell directly below the top-left cell
S[X-1, Y, Z]

The result is identical to S[0, 0, 0]

However, when copying the input with Crtl-C and Ctrl-V, the link stays
relative while the other link is absolute.

2) Python batteries

Library import can be done as follows:
decimal = __import__("decimal")

in one cell and
decimal.Decimal(1)

in the next cell. The calculations will be done with the object while
the string representation is displayed in the grid.

Since some functionality should not be done in one-line expression,
functions can be defined in the Macro list.

In the menu, select Macro -> Macro list.
def mysandwich(spam, eggs, bacon):
"""Add spam, eggs, and bacon."""
return spam + eggs + bacon

After clicking on Add in the top left of the dialog, the function is
accessible from each cell. The macro form (middle right) allows filling
in the parameters and Ok inserts the function into the selected cell.

When doing changes to the code, Apply alters the current function
including the function name while Add lets you create a new function by
changing the function name.

3) Spreading data

Often, a cell may return a list or a matrix, which is nice for
calculations but bad for export and presentation. Therefore, arrays and
matrices can be spread out into cells using the grid's spread method.

In cell 2,0,0 type:
[1, 2, 3]

In cell 3,0,0 type:
S.spread(4, 0, 0, S[2,0,0])

Then in the cells 4,0,0 - 6,0,0, the array will be displayed.

---

I hope that this helps as a quick start.


Best Regards

Martin
 
C

Colin J. Williams

Are you planning any documentation?

Actually, yes.
0.0.10 will feature some docs.
Any help writing and doing the layout is highly appreciated ;-)
I've tried:
# tpySpread.py
print 'start'
import pyspread
print pyspread.__doc__
[snip]

I hope that this helps as a quick start.


Best Regards

Martin
I've copied your tutorial in my
site-packages\pyspread directory

When I try it (a) I can't open your test
data and (b)I enter 1 in [0,0], 'abc' in
[0,1], 'def' in [0,2] and 'ghi' in [1.2].

The first gives an unable to find rpy
message and the second doesn't display.

Here is a copy of the spreadsheet:

1 'def'
__import__("math") 'ghi'
a = numpy.arange(-1,1,.001)

rpy.r.plot(a,b,xlab='',ylab='',type='l')

I hope that this helps.

Colin W.
 
M

Martin Manns

I've copied your tutorial in my
site-packages\pyspread directory

I wrote the tutorial in this thread as a step by step guide that
can be followed manually. You do not need to put it anywhere on your
hard drive. Start pyspread and type in the lines starting with "> "
manually.
When I try it (a) I can't open your test
data and (b)I enter 1 in [0,0], 'abc' in
[0,1], 'def' in [0,2] and 'ghi' in [1.2].

I assume that you tried to open the "test.pys" file. This file is not
needed for the tutorial. Type in as you did into the empty grid and it
should work.
(Please tell me if it does not display 1 in [0,0], abc in [0,1], def in
[0,2] and ghi in [1,2].)
The first gives an unable to find rpy
message and the second doesn't display.

The "test.pys" file is an example how to use the 3rd party package rpy
for convenient plotting. Probably on your system, rpy is not installed.
When you install rpy, do not forget to install the statistics package R
that it depends on as well.

However, you do not have to use rpy for plotting. If you prefer other
plotting packages (e.g. gnuplot), feel free to import them as displayed
with the decimal built-in package. You can import (almost) everything
that you can import in any Python program (though matplotlib made some
trouble the last time I tried).

(Hint: pyspread does *not* protect your system in any special way. So if
you write a system command to delete all files and have sufficient
rights to do this, the files will be deleted.)

Please let me know, which OS you are using (Unix/Linux, MacOS, Windows
or something else).

Best Regards

Martin
 
C

Colin J. Williams

Martin said:
I wrote the tutorial in this thread as a step by step guide that
can be followed manually. You do not need to put it anywhere on your
hard drive. Start pyspread and type in the lines starting with "> "
manually.
This was just for interim project
documwntation
When I try it (a) I can't open your test
data and (b)I enter 1 in [0,0], 'abc' in
[0,1], 'def' in [0,2] and 'ghi' in [1.2].

I assume that you tried to open the "test.pys" file.
Yes, nothing was loaded.
This file is not
needed for the tutorial. Type in as you did into the empty grid and it
should work. It did not.
(Please tell me if it does not display 1 in [0,0], abc in [0,1], def in
[0,2] and ghi in [1,2].)
The first gives an unable to find rpy
message and the second doesn't display.

The "test.pys" file is an example how to use the 3rd party package rpy
for convenient plotting. Probably on your system, rpy is not installed.
When you install rpy, do not forget to install the statistics package R
that it depends on as well.
I suggest that such prerequisites go in
the __doc__.
However, you do not have to use rpy for plotting. If you prefer other
plotting packages (e.g. gnuplot), feel free to import them as displayed
with the decimal built-in package. You can import (almost) everything
that you can import in any Python program (though matplotlib made some
trouble the last time I tried).

(Hint: pyspread does *not* protect your system in any special way. So if
you write a system command to delete all files and have sufficient
rights to do this, the files will be deleted.)

Please let me know, which OS you are using (Unix/Linux, MacOS, Windows
or something else).

Windows XP Pro
Best Regards

Martin

I'll get rpy to try it again in a few days.

Colin W.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ANN: pyspread 0.0.9 0
ANN: pyspread 0.0.1 1
pyspread 0.0.7 0
ANN: pyspread 0.0.5 1
[ANN] pyspread 0.2.6 1
[ANN] pyspread 0.2.3 0
[ANN] pyspread 0.2.5 0
[ANN] pyspread 0.2.4 0

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top