Python Office Applications

A collection links and info about Python spreadsheets, notebooks, libraries for OpenOffice/Word/Excel compatibility, etc. Any applications suitable for a small business or home office that don't depend directly on Open Office.

The category also includes links about simple validation engines and inference engines, such as they are. Many projects have become inactive.



... 2017-01-31 173KB ...

Openpyxl is a Python library for reading and writing Excel 2010 xlsx/xlsm/xltx/xltm files.

from openpyxl import Workbook
wb = Workbook()

# grab the active worksheet
ws =

# Data can be assigned directly to cells
ws['A1'] = 42

# Rows can also be appended
ws.append([1, 2, 3])

# Python types will automatically be converted
import datetime
ws['A2'] =

# Save the file"sample.xlsx")

Simple example ->

More extensive examples ->

... Pyspread expects Python expressions in its grid cells, which makes a spreadsheet specific language obsolete. Each cell returns a Python object that can be accessed from other cells. These objects can represent anything including lists or matrices.

Google Spreadsheets Python API ->

Logical Spreadsheets

This category verges on a validation/interference engine, if done correctly.

A really simple example.

A < 3 A = 3 A > 3
B = 'This' C = 'OK' C = 'OK' C = 'NotOK'
B = 'That' C = 'NotOK' C = 'OK' C = 'OK'

Simple flow for lookup, but more complex in that each result cell can be a Python script referencing other worksheet cells, producing a primitive form of backchaining and defaulting over ranges of cells ( such as when A or B is Unknown or the result values are redundant over several cells.

Sometimes, defaulting and redundancy can be handled using variations of Python functional programming.

PythonTools#IPython notebooks are powerful ( Python in cells ) and a pretty easy to use as an integration tool.

IPython requires a fair number of packages to install correctly, but they are 'good' dependencies in themselves. Lots of functionality. Might become a 'must-have' component.

... Now, in the past, installing the IPython Notebook and all of its dependencies has been really difficult. Thanks to resources like Enthought and Anaconda, the install process is streamlined. ...

... openpyxl is for reading in excel spreadsheets. statlib is for statistical analyses ...

Starting overlap scientific Python toolsets.

pyDatalog - >

Datalog excels at managing complexity. Datalog programs are shorter than their Python equivalent, and Datalog statements can be specified in any order, as simply as formula in a spreadsheet.

Simple Automation Tools And Techniques - good book

Also See

PythonOpenOffice - Python tools specific to OpenOffice

Last modified 22 months ago Last modified on 02/11/2017 03:09:41 PM