A python server harnessing the calculational ability of LibreOffice Calc (thanks to 'pyoo'). It provides 'instant' access to the cell ranges of a set of spreadsheets.
License: GNU General Public License v2.0
Python 100.00%
spreadsheet_server's Introduction
------------
Introduction
------------
spreadsheet_server was built to aid rapid web tool development where the logic
was already implemented in Microsoft Excel/LibreOffice Calc. Instead of
rewriting the logic from scratch, this tool was born.
The tool has been developed to work on a headless GNU/Linux system where the
server and client are on the same machine.
--------
Features
--------
* 'Instant' access to cells in the spreadsheets because they open in
LibreOffice Calc.
* All the function calculation support and power of LibreOffice Calc.
* Server requests are threaded so concurrent connections to different
spreadsheets are supported.
* A given spreadsheet is locked (within python, not on disk) when it is accessed
to prevent state irregularities across multiple concurrent connections to the
same spreadsheet.
* Spreadsheets can be saved - useful for debugging purposes.
-----
Usage
-----
Place your spreadsheets in './spreadsheets'.
Make sure you have a correctly set up virtualenv and required packages installed
(see below), then run the server:
python server.py
Have a look at the example_client.py for an overview of how to use the functions
exposed by client.py.
------------
How it works
------------
A LibreOffice instance is launched by 'server.py' in a headless state.
By default, the './spreadsheets' directory is polled every 60 seconds for file
changes.
New spreadsheets in the directory are opened with LibreOffice and removed
spreadsheets are closed in LibreOffice.
The 'client.py' connects to the server and can update cells and retrieve
their calculated content.
------------
Requirements
------------
Server:
LibreOffice Calc
python3
virtualenv created with '--system-site-packages' argument
For example: "virtualenv --system-site-packages -p python3 venv"
Python packages installed to the virtualenv:
pyoo (for the connection to LibreOffice)
werkzeug (for securing filenames when saving spreadsheets)
Client:
python2 or python3.