usage: odsgenerator.py [-h] [--version] input_file output_file

Generates an ODF .ods file from json or yaml file.

positional arguments:
  input_file   input file containing data in json or yaml format
  output_file  output file, .ods file generated from input

optional arguments:
  -h, --help   show this help message and exit
  --version    show program's version number and exit

This script parses a JSON or YAML description of tables and generates an
ODF document using the odfdo library.
    - description can be minimalist: a list of lists of lists,
    - description can be complex, allowing styles at row or cell level.

Principle:
    - a document is a list of tabs,
    - a tab is a list of rows,
    - a row is a list of cells.

A cell can be:
    - int, float or str
    - a dict, with the following keys (only the 'value' key is mandatory):
        - value: int, float or str
        - style: str or list of str, a style name or a list of style names
        - text: str, a string representation of the value (for ODF readers
          who use it).

A row can be:
    - a list of cells
    - a dict, with the following keys (only the 'row' key is mandatory):
        - row: a list of cells, see above
        - style: str or list of str, a style name or a list of style names

A tab can be:
    - a list of rows
    - a dict, with the following keys (only the 'table' key is mandatory):
        - table: a list of rows,
        - width: a list containing the width of each column of the table
        - name: str, the name of the tab
        - style: str or list of str, a style name or a list of style names

A tab may have some post transformation:
    - a list of span areas, cell coordinates are defined in the tab after its
      creation using odfo method Table.set_span(), ie. Table.set_span("A1:B:3")
      or Table.set_span([0, 0, 2, 1])

A document can be:
    - a list of tabs
    - a dict, with the following keys (only the 'body' key is mandatory):
        - body: a list of tabs
        - styles: a list of dict of styles definitions
        - defaults: a dict, for the defaults styles

A style definition is a dict with 2 items:
    - name: str, the name of the style.
    - an XML definition of the ODF style, see list below.

The styles provided for a row or a table can be of family table-row or
table-cell, they apply to row and below cells. A style defined at a
lower level (cell for instance) has priority over the style defined above
(row for instance).

In short, if you don't need custom styles, this is a valid document
description:
    '[ [ ["a", "b", "c" ] ] ]'

This json string will create a document with only one tab (name will
be "Tab 1" by default), containing one row of 3 values "a", "b", "c".

Styles:
    - the DEFAULT_STYLES constant defines styles always available, they can be
      called by their name for cells or rows.
    - To add a custom style, use the "styles" category of the document dict.
      A style is a dict with 2 keys, "definition" and "name".

List of provided styles:
grid_06pt means the cell is surrounded by a black border of 0.6 points,
gray means the cell has a gray background.
The file doc/styles.ods shows all the provided styles.

Row styles:
    - default_table_row
    - table_row_1cm
Cell styles:
    - bold
    - bold_center
    - left
    - right
    - center
    - cell_decimal1
    - cell_decimal2
    - cell_decimal3
    - cell_decimal4
    - cell_decimal6
    - grid_06pt
    - bold_left_bg_gray_grid_06pt
    - bold_right_bg_gray_grid_06pt
    - bold_center_bg_gray_grid_06pt
    - bold_left_grid_06pt
    - bold_right_grid_06pt
    - bold_center_grid_06pt
    - left_grid_06pt
    - right_grid_06pt
    - center_grid_06pt
    - integer_grid_06pt
    - integer_no_zero_grid_06pt
    - center_integer_no_zero_grid_06pt
    - decimal1_grid_06pt
    - decimal2_grid_06pt
    - decimal3_grid_06pt
    - decimal4_grid_06pt
    - decimal6_grid_06pt
