src/iwork/numbers

Search:
Group by:
Source   Edit  

structured numbers reading: tn.documentarchive -> sheets -> table infos -> table models -> tiles -> decoded cell grids. field numbers verified against real documents with numbers-parser as the reference.

Example: cmd: -r:off

import src/iwork/numbers
import iwork
let book = openDocument("budget.numbers")
for sheet in book.sheets:
  for table in sheet.tables:
    echo sheet.name, " / ", table.name
    echo toCsv(table)

Types

Sheet = object
  name*: string
  tables*: seq[Table]
  textBoxes*: seq[string]    ## text of the sheet's text boxes, in
                             ## drawable order
one sheet and the tables on it Source   Edit  
Table = object
  name*: string
  numRows*: int
  numCols*: int
one table's decoded cell grid Source   Edit  

Procs

proc cell(t: Table; row, col: int): CellValue {....raises: [IworkError], tags: [],
    forbids: [].}
the decoded value at a 0-based row/column position Source   Edit  
proc numbersSheets(idx: ObjectIndex): seq[Sheet] {.
    ...raises: [IworkFormatError, KeyError, Exception], tags: [RootEffect],
    forbids: [].}
walks the numbers document into sheets with decoded tables Source   Edit  
proc toCsv(t: Table): string {....raises: [], tags: [], forbids: [].}
the whole grid as csv, one line per row Source   Edit  

Iterators

iterator rows(t: Table): seq[CellValue] {....raises: [], tags: [], forbids: [].}
yields each row of the grid in order Source   Edit