A library allowing you to use an array of strings as runnable code, opening the door for a fully-featured and hackable spreadsheet software. This means that you can use a CSV file as a dynamic spreadsheet. The example runcsv-minimal
in my repositories is an example of using a CSV file as input and the output will be the resulting values after running the spreadsheet. A GUI Spreadsheet project is in progress in runcsv-gui
.
The structure of the spreadsheet is divided in 4 layers:
s
: This layer is the source, the user inputp
: This is the result after parsing the cell in the source layers
to generate the runnable python code.o
: This is the resulting object after evaluating the cell in thep
layer usingeval
f
: This layer is the resulting string after changing the object ino
into a string using the object's__str__
function.
Every step from one layer to another is very straight-forward. Any cell is either:
- A String cell (normal cells), which has no "
=
" in the beginning of the cell content- The parsed (
p
) layer will contain exactly what the source layer contains - The object (
o
) layer will contain the string python object identical to thep
- The final (
f
) layer will also be identical to theo
layer. - This means that all the cells will be unchanged by the spreadsheet
- The parsed (
- A command cell, which has a "
=
" in the beginning of the cell.- The parsed (
p
) layer will contain the generated python command after replacing the specified references, if given:*{i,j}
: This will be replaced by thep
layer of the referenced celli,j
{i,j}
: This will be replaced by thef
layer of the referenced celli,j
- The object (
o
) layer will contain the python object after running the generated python code in thep
layer. - The final (
f
) layer will contain the string (__str__
) of the object in theo
layer
- The parsed (
The example driver provided parses the CSV file as source (s
) layer and outputs the final (f
) layer as a CSV file.
This was designed as the engine for a spreadsheet software currently in development