GSS.Spreadsheet (elixir_google_spreadsheets v0.3.2)

Model of Google Spreadsheet for external interaction.

Link to this section Summary

Types

State of currently active Google spreadsheet

Functions

Append row in a spreadsheet after an index.

Batch update to append multiple rows.

Returns a specification to start this module under a supervisor.

Clear row in a spreadsheet by index.

Batched clear, which deletes more then one record. Pass either an array of ranges, or start and end row indexes.

Granural read by a custom range from a spreadsheet.

Get spreadsheet internal id.

Callback implementation for GenServer.init/1.

Get spreadsheet properties.

Read row in a spreadsheet by index.

Batched read, which returns more than one record. Pass either an array of ranges (or rows), or start and end row indexes.

Get total amount of rows in a spreadsheet.

Get spreadsheet sheets from properties.

Override row in a spreadsheet by index.

Batch update to write multiple rows.

Link to this section Types

Link to this type

spreadsheet_data()

Specs

spreadsheet_data() :: [String.t()]
Link to this type

spreadsheet_response()

Specs

spreadsheet_response() :: {:json, map()} | {:error, Exception.t()} | no_return()

Specs

state() :: map()

State of currently active Google spreadsheet:

%{
    spreadsheet_id => "16Wgt0fuoYDgEAtGtYKF4jdjAhZez0q77UhkKdeKI6B4",
    list_name => nil
}

Link to this section Functions

Link to this function

append_row(pid, row_index, column_list, options \\ [])

Specs

append_row(pid(), integer(), spreadsheet_data(), Keyword.t()) :: :ok

Append row in a spreadsheet after an index.

Link to this function

append_rows(pid, row_index, data, options \\ [])

Specs

append_rows(pid(), integer(), [spreadsheet_data()], Keyword.t()) ::
  :ok | {:error, Exception.t()}

Batch update to append multiple rows.

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

clear_row(pid, row_index, options \\ [])

Specs

clear_row(pid(), integer(), Keyword.t()) :: :ok

Clear row in a spreadsheet by index.

Link to this function

clear_rows(pid, ranges)

Specs

clear_rows(pid(), [String.t()]) :: :ok | {:error, Exception.t()}

Batched clear, which deletes more then one record. Pass either an array of ranges, or start and end row indexes.

Link to this function

clear_rows(pid, ranges, options)

Specs

clear_rows(pid(), [String.t()], Keyword.t()) :: :ok | {:error, Exception.t()}
clear_rows(pid(), integer(), integer()) :: :ok | {:error, Exception.t()}
Link to this function

clear_rows(pid, row_index_start, row_index_end, options)

Specs

clear_rows(pid(), integer(), integer(), Keyword.t()) ::
  :ok | {:error, Exception.t()}
Link to this function

col_number_to_letters(col_number)

Specs

col_number_to_letters(integer()) :: String.t()
Link to this function

fetch(pid, range)

Specs

fetch(pid(), String.t()) :: {:ok, spreadsheet_data()} | {:error, Exception.t()}

Granural read by a custom range from a spreadsheet.

Specs

id(pid()) :: String.t()

Get spreadsheet internal id.

Specs

init({String.t(), Keyword.t()}) :: {:ok, state()}

Callback implementation for GenServer.init/1.

Link to this function

properties(pid)

Specs

properties(pid()) :: map()

Get spreadsheet properties.

Link to this function

range(row_from, row_to, column_from, column_to)

Specs

range(integer(), integer(), integer(), integer()) :: String.t()
Link to this function

range(row_from, row_to, column_from, column_to, state)

Specs

range(integer(), integer(), integer(), integer(), state()) :: String.t()
Link to this function

read_row(pid, row_index, options \\ [])

Specs

read_row(pid(), integer(), Keyword.t()) ::
  {:ok, spreadsheet_data()} | {:error, Exception.t()}

Read row in a spreadsheet by index.

Link to this function

read_rows(pid, ranges)

Specs

read_rows(pid(), [String.t()] | [integer()]) ::
  {:ok, [spreadsheet_data() | nil]} | {:error, Exception.t()}

Batched read, which returns more than one record. Pass either an array of ranges (or rows), or start and end row indexes.

By default it returns nils for an empty rows, use pad_empty: true and column_to: integer options to fill records with an empty string values.

Link to this function

read_rows(pid, ranges, options)

Specs

read_rows(pid(), [String.t()] | [integer()], Keyword.t()) ::
  {:ok, [spreadsheet_data()]} | {:error, Exception.t()}
read_rows(pid(), integer(), integer()) ::
  {:ok, [spreadsheet_data()]} | {:error, atom()}
Link to this function

read_rows(pid, row_index_start, row_index_end, options)

Specs

read_rows(pid(), integer(), integer(), Keyword.t()) ::
  {:ok, [spreadsheet_data()]} | {:error, atom()}
Link to this function

rows(pid, options \\ [])

Specs

rows(pid(), Keyword.t()) :: {:ok, integer()} | {:error, Exception.t()}

Get total amount of rows in a spreadsheet.

Link to this function

sheets(pid, opts \\ [])

Specs

sheets(pid(), Keyword.t()) :: [map()] | map()

Get spreadsheet sheets from properties.

Link to this function

start_link(spreadsheet_id, opts)

Specs

start_link(String.t(), Keyword.t()) :: {:ok, pid()}
Link to this function

write_row(pid, row_index, column_list, options \\ [])

Specs

write_row(pid(), integer(), spreadsheet_data(), Keyword.t()) :: :ok

Override row in a spreadsheet by index.

Link to this function

write_rows(pid, ranges, data, opts \\ [])

Specs

write_rows(pid(), [String.t()], [spreadsheet_data()], Keyword.t()) ::
  :ok | {:error, Exception.t()}

Batch update to write multiple rows.

Range schema should define the same amount of rows as amound of records in data and same amount of columns as entries in data record.