package SZXX
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module SZXX.XlsxSource
val stream_rows :
?only_sheet:int ->
?skip_sst:bool ->
feed:Zip.feed ->
'a cell_parser ->
'a status row Lwt_stream.t * SST.t Lwt.t * unit Lwt.tReturns an Lwt_stream.t of fully parsed XLSX rows, with one caveat: every cell value is wrapped in 'a status. The status can be either Available of 'a or Delayed of delayed_string.
This function will not wait on delayed string cells (see README).
Returns stream * sst_promise * success_promise.
Await success_promise before awaiting the completion of any promise resulting from the stream.
See README.md for examples.
val stream_rows_buffer :
?only_sheet:int ->
feed:Zip.feed ->
'a cell_parser ->
'a row Lwt_stream.t * unit Lwt.tSame as stream_rows but automatically resolves string references. Warning: This function can result in linear (as opposed to constant) memory usage. See README for more information.
val stream_rows_unparsed :
?only_sheet:int ->
?skip_sst:bool ->
feed:Zip.feed ->
unit ->
Xml.DOM.element row Lwt_stream.t * SST.t Lwt.t * unit Lwt.tSame as stream_rows but returns raw XML elements instead of parsed XLSX rows. This function can be useful to filter out uninteresting rows at a lower cost.
val yojson_cell_parser :
[> `Bool of bool | `Float of float | `String of string | `Null ] cell_parserConvenience cell_parser to read rows as JSON (Yojson)
Convert an XML element as returned by stream_rows_unparsed into a nicer 'a row as returned by stream_rows_buffer
Convert an XML element as returned by stream_rows_unparsed into a nicer 'a status row as returned by stream_rows
Unwrap a single row, resolving all SST references.
A common workflow is to call Lwt_stream.filter on the stream returned by stream_rows, discarding uninteresting rows in order to buffer as few rows as possible, then await the sst Lwt.t, and finally consume the stream, calling unwrap_status on each row to get the String data.
Resolve a single reference into the Shared Strings Table.
XLSX dates are stored as floats. Convert from a float to a Date.t
XLSX datetimes are stored as floats. Convert from a float to a Time.t
Convert from a column reference such as "D7" or "AA2" to a 0-based column index