elixir_google_spreadsheets v0.1.5 GSS.Spreadsheet

Model of Google Spreadsheet for external interaction.

Maximum size of the supported canvas is 1000 x 26 cells.

Summary

Types

State of currently active Google spreadsheet:

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

Functions

Append row in a spreadsheet after an index

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

Write values in batch based on a ranges schema

Get spreadsheet internal id

Get spreadsheet properties

Read row in a spreadsheet by index

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

Get total amount of rows in a spreadsheet

Override row in a spreadsheet by index

Batch update to write multiple rows

Types

spreadsheet_data()
spreadsheet_data() :: [String.t]
spreadsheet_response()
spreadsheet_response() :: {:json, map} | {:error, Exception.t}
state()
state() :: map

State of currently active Google spreadsheet:

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

Functions

append_row(pid, row_index, column_list, options \\ [])
append_row(pid, integer, spreadsheet_data, Keyword.t) :: :ok

Append row in a spreadsheet after an index.

clear_row(pid, row_index, options \\ [])
clear_row(pid, integer, Keyword.t) :: :ok

Clear row in a spreadsheet by index.

clear_rows(pid, ranges)
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.

clear_rows(pid, ranges, options)
clear_rows(pid, [String.t], Keyword.t) ::
  :ok |
  {:error, Exception.t}
clear_rows(pid, integer, integer) ::
  :ok |
  {:error, Exception.t}
clear_rows(pid, row_index_start, row_index_end, options)
clear_rows(pid, integer, integer, Keyword.t) ::
  :ok |
  {:error, Exception.t}
fetch(pid, range)
fetch(pid, String.t) ::
  {:ok, spreadsheet_data} |
  {:error, Exception.t}

Granural read by a custom range from a spreadsheet.

handle_call(msg, from, state)

Write values in batch based on a ranges schema.

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

Get spreadsheet internal id.

properties(pid)
properties(pid) :: map

Get spreadsheet properties.

range(row_from, row_to, column_from, column_to)
range(integer, integer, integer, integer) :: String.t
range(row_from, row_to, column_from, column_to, state)
range(integer, integer, integer, integer, state) :: String.t
read_row(pid, row_index, options \\ [])
read_row(pid, integer, Keyword.t) ::
  {:ok, spreadsheet_data} |
  {:error, Exception.t}

Read row in a spreadsheet by index.

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

Batched read, which returns more then 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.

read_rows(pid, ranges, options)
read_rows(pid, [String.t] | [integer], Keyword.t) ::
  {:ok, [spreadsheet_data]} |
  {:error, Exception.t}
read_rows(pid, integer, integer) ::
  {:ok, [spreadsheet_data]} |
  {:error, Exception.t}
read_rows(pid, row_index_start, row_index_end, options)
read_rows(pid, integer, integer, Keyword.t) ::
  {:ok, [spreadsheet_data]} |
  {:error, Exception.t}
rows(pid)
rows(pid) :: {:ok, integer} | {:error, Exception.t}

Get total amount of rows in a spreadsheet.

start_link(spreadsheet_id, opts)
start_link(String.t, Keyword.t) :: {:ok, pid}
write_row(pid, row_index, column_list, options \\ [])
write_row(pid, integer, spreadsheet_data, Keyword.t) :: :ok

Override row in a spreadsheet by index.

write_rows(pid, ranges, data)
write_rows(pid, [String.t], [spreadsheet_data]) :: :ok

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.

write_rows(pid, ranges, data, options)
write_rows(pid, [String.t], [spreadsheet_data], Keyword.t) :: :ok