GoogleSheets.jl Documentation
Enums
GoogleSheets.AuthScope — TypeAn authorization scope for accessing Google resources.
AUTH_SCOPE_READONLY: Allows read-only access to the user's sheets and their properties.AUTH_SCOPE_READWRITE: Allows read/write access to the user's sheets and their properties.
GoogleSheets.ValueType — TypeA Google Sheets value type.
VALUE_TYPE_MIN: minimum value in a rangeVALUE_TYPE_MAX: maximum value in a rangeVALUE_TYPE_NUMBER: exact numberVALUE_TYPE_PERCENT: percentage of a rangeVALUE_TYPE_PERCENTILE: percentile of a range
GoogleSheets.ConditionType — TypeA Google Sheets condition type.
CONDITION_TYPE_NUMBER_GREATER: value must be greater than the condition value.CONDITION_TYPE_NUMBER_GREATER_THAN_EQ: value must be greater than or equal to the condition value.CONDITION_TYPE_NUMBER_LESS: value must be less than the condition value.CONDITION_TYPE_NUMBER_LESS_THAN_EQ: value must be less than or equal to the condition value.CONDITION_TYPE_NUMBER_EQ: value must be equal to the condition value.CONDITION_TYPE_NUMBER_NOT_EQ: value must not be equal to the condition value.CONDITION_TYPE_NUMBER_BETWEEN: value must be between the two condition values.CONDITION_TYPE_NUMBER_NOT_BETWEEN: value must not be between the two condition values.CONDITION_TYPE_TEXT_CONTAINS: value must contain the condition value.CONDITION_TYPE_TEXT_NOT_CONTAINS: value must not contain the condition value.CONDITION_TYPE_TEXT_STARTS_WITH: value must start with the condition value.CONDITION_TYPE_TEXT_ENDS_WITH: value must end with the condition value.CONDITION_TYPE_TEXT_EQ: value must equal the condition value.CONDITION_TYPE_TEXT_NOT_EQ: value must not equal the condition value.CONDITION_TYPE_TEXT_IS_EMAIL: value must be a valid email address.CONDITION_TYPE_TEXT_IS_URL: value must be a valid URL.CONDITION_TYPE_DATE_EQ: value must have the same date as the condition value.CONDITION_TYPE_DATE_NOT_EQ: value must not have the same date as the condition value.CONDITION_TYPE_DATE_BEFORE: value's date must be before the date of the condition value.CONDITION_TYPE_DATE_AFTER: value's date must be before the date of the condition value.CONDITION_TYPE_DATE_ON_OR_BEFORE: value's date must be on or before the date of the condition value.CONDITION_TYPE_DATE_ON_OR_AFTER: value's date must be on or after the date of the condition value.CONDITION_TYPE_DATE_BETWEEN: value's date must be between the dates of the condition values.CONDITION_TYPE_DATE_NOT_BETWEEN: value's date must not be between the dates of the condition values.CONDITION_TYPE_DATE_IS_VALID: value must be a date.CONDITION_TYPE_ONE_OF_LIST: value must be present in the condition values.CONDITION_TYPE_BLANK: value must be empty.CONDITION_TYPE_NOT_BLANK: value must not be empty.CONDITION_TYPE_CUSTOM_FORMULA: condition formula must evaluate to true.CONDITION_TYPE_BOOLEAN: value must be TRUE/FALSE.CONDITION_TYPE_ONE_OF_RANGE: value is present in the condition value's cell range.
GoogleSheets.NumberFormatType — TypeA Google Sheets number format type.
NUMBER_FORMAT_TYPE_TEXT: text formatting, e.g.1000.12NUMBER_FORMAT_TYPE_NUMBER: number formatting, e.g.1,000.12NUMBER_FORMAT_TYPE_PERCENT: percent formatting, e.g.10.12%NUMBER_FORMAT_TYPE_CURRENCY: currency formatting, e.g.$ 1,000.12NUMBER_FORMAT_TYPE_DATE: date formatting, e.g.9/26/2008NUMBER_FORMAT_TYPE_TIME: time formatting, e.g.3:59:00 PMNUMBER_FORMAT_TYPE_DATE_TIME: date+time formatting, e.g.9/26/08 15:59:00NUMBER_FORMAT_TYPE_SCIENTIFIC: scientific number formatting, e.g.1.01E+03
Types
GoogleSheets.GoogleSheetsClient — TypeA Google Sheets client.
GoogleSheets.Spreadsheet — TypeA spreadsheet.
GoogleSheets.Sheet — TypeA sheet in a spreadsheet.
GoogleSheets.CellRange — TypeA range of cells within a spreadsheet.
GoogleSheets.CellRanges — TypeMultiple ranges of cells within a spreadsheet.
GoogleSheets.CellRangeValues — TypeA range of cell values within a spreadsheet.
GoogleSheets.UpdateSummary — TypeSummary of updated updated cells.
GoogleSheets.CellIndexRange1D — Type1D Range of cell values.
GoogleSheets.CellIndexRange2D — Type2D Range of cell values.
GoogleSheets.CellFormat — TypeFormatting for a cell.
DataFrames.DataFrame — TypeDataFrame(values::CellRangeValues)::Union{Nothing,DataFrame}Creates a DataFrame from spreadsheet range values. The first row is converted to column names. All other rows are converted to string values.
Arguments
values::CellRangeValues: cell values
Functions
GoogleSheets.sheets_client — Functionsheets_client(scopes::Union{AuthScope,Array{AuthScope,1}};
rate_limiter_read::AbstractRateLimiter=default_rate_limiter_read,
rate_limiter_write::AbstractRateLimiter=default_rate_limiter_write)::GoogleSheetsClientCreates a client for accessing Google Sheets.
Arguments
scopes::Union{AuthScope,Array{AuthScope,1}}: authorization scopes.rate_limiter_read::AbstractRateLimiter=default_rate_limiter_read: rate limiter for reading.rate_limiter_write::AbstractRateLimiter=default_rate_limiter_write: rate limiter for writing.
GoogleSheets.sheet_names — Functionsheet_names(client::GoogleSheetsClient, spreadsheet::Spreadsheet)::Vector{String}Gets the names of the sheets in the spreadsheet.
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheet
GoogleSheets.sheets — Functionsheets(client::GoogleSheetsClient, spreadsheet::Spreadsheet)::Vector{Sheet}Gets the sheets in the spreadsheet.
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheet
GoogleSheets.batch_update! — Functionbatch_update!(client::GoogleSheetsClient, spreadsheet::Spreadsheet, body::Dict)::Dict{Any,Any}Applies one or more updates to a spreadsheet.
Each request is validated before being applied. If any request is not valid then the entire request will fail and nothing will be applied.
Common batch_update! functionality: Charts: https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/charts Filters: https://developers.google.com/sheets/api/guides/filters Basic formatting: https://developers.google.com/sheets/api/samples/formatting Conditional formatting: https://developers.google.com/sheets/api/samples/conditional-formatting Conditional formatting: https://developers.google.com/sheets/api/guides/conditional-format
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheetbody::Dict: updte body
GoogleSheets.add_sheet! — Functionadd_sheet!(client::GoogleSheetsClient, spreadsheet::Spreadsheet, title::AbstractString)::Dict{Any,Any}Adds a new sheet to a spreadsheet.
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheettitle::AbstractString: sheet title
GoogleSheets.delete_sheet! — Functiondelete_sheet!(client::GoogleSheetsClient, spreadsheet::Spreadsheet, title::AbstractString)::Dict{Any,Any}Removes a sheet from a spreadsheet.
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheettitle::AbstractString: sheet title
delete_sheet!(client::GoogleSheetsClient, spreadsheet::Spreadsheet, sheet_id::Int64)::Dict{Any,Any}Removes a sheet from a spreadsheet.
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheetsheet_id::Int64: sheet id
GoogleSheets.freeze! — Functionfreeze!(client::GoogleSheetsClient, sheet::Sheet, rows::Int64=0, cols::Int64=0)::Dict{Any,Any}Freeze rows and columns in a sheet.
Arguments
client::GoogleSheetsClient: clientsheet::Sheet: sheetrows::Int64=0: number of rowscols::Int64=0: number of columns
Base.append! — Functionappend!(client::GoogleSheetsClient, sheet::Sheet, rows::Int64=0, cols::Int64=0)::Dict{Any,Any}Append rows and columns to a sheet.
Arguments
client::GoogleSheetsClient: clientsheet::Sheet: sheetrows::Int64=0: number of rowscols::Int64=0: number of columns
GoogleSheets.insert_rows! — Functioninsert_rows!(client::GoogleSheetsClient, range::CellIndexRange1D)::Dict{Any,Any}Insert rows into to a sheet.
Arguments
client::GoogleSheetsClient: clientrange::CellIndexRange1D: cell index range
GoogleSheets.insert_cols! — Functioninsert_cols!(client::GoogleSheetsClient, range::CellIndexRange1D)::Dict{Any,Any}Insert columns into to a sheet.
Arguments
client::GoogleSheetsClient: clientrange::CellIndexRange1D: cell index range
GoogleSheets.delete_rows! — FunctionDelete rows from a sheet.
Arguments
client::GoogleSheetsClient: clientrange::CellIndexRange1D: cell index range
GoogleSheets.delete_cols! — Functiondelete_cols!(client::GoogleSheetsClient, range::CellIndexRange1D)::Dict{Any,Any}Delete columns from a sheet.
Arguments
client::GoogleSheetsClient: clientrange::CellIndexRange1D: cell index range
GoogleSheets.meta — Functionmeta(client::GoogleSheetsClient, spreadsheet::Spreadsheet)::Dict{Any,Any}Gets metadata about a spreadsheet.
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheet
meta(client::GoogleSheetsClient, spreadsheet::Spreadsheet, key::AbstractString, value)::Dict{Any,Any}Gets metadata about a spreadsheet key-value pair.
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheetkey:AbstractString: keyvalue: value
meta(client::GoogleSheetsClient, spreadsheet::Spreadsheet, title::AbstractString)::Dict{Any,Any}Gets metadata about a spreadsheet sheet.
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheettitle::AbstractString: sheet title
meta(client::GoogleSheetsClient, spreadsheet::Spreadsheet, sheet_id::Int64)::Dict{Any,Any}Gets metadata about a spreadsheet sheet.
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheetsheet_id::Int64: sheet id
meta(client::GoogleSheetsClient, sheet::Sheet)::Dict{Any,Any}Gets metadata about a spreadsheet sheet.
Arguments
client::GoogleSheetsClient: clientsheet::Sheet: sheet
Base.show — Functionshow(client::GoogleSheetsClient, spreadsheet::Spreadsheet)Prints metadata about a spreadsheet.
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheet
show(client::GoogleSheetsClient, spreadsheet::Spreadsheet, title::AbstractString)Prints metadata about a spreadsheet sheet.
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheettitle::AbstractString: sheet title
show(client::GoogleSheetsClient, spreadsheet::Spreadsheet, sheet_id::Int64)Prints metadata about a spreadsheet sheet.
Arguments
client::GoogleSheetsClient: clientspreadsheet::Spreadsheet: spreadsheetsheet_id::Int64: sheet id
show(client::GoogleSheetsClient, sheet::Sheet)Prints metadata about a spreadsheet sheet.
Arguments
client::GoogleSheetsClient: clientsheet::Sheet: sheet
Base.get — Functionget(client::GoogleSheetsClient, range::CellRange)::CellRangeValuesGets a range of cell values from a spreadsheet.
Arguments
client::GoogleSheetsClient: clientrange::CellRange: cell range
get(client::GoogleSheetsClient, ranges::CellRanges)::Vector{CellRangeValues}Gets multiple ranges of cell values from a spreadsheet.
Arguments
client::GoogleSheetsClient: clientranges::CellRanges: cell ranges
GoogleSheets.update! — Functionupdate!(client::GoogleSheetsClient, range::CellRange, values::Array{<:Any,2}; raw::Bool=false)::UpdateSummaryUpdates a range of cell values in a spreadsheet.
Arguments
client::GoogleSheetsClient: client for interacting with Google Sheets.range::CellRange: cell range to modify.values::Array{<:Any,2}: values to place in the spreadsheet.raw::Bool=false: true treats values as raw, unparsed values and and are simply inserted as a string. false treats values exactly as if they were entered into the Google Sheets UI, for example "=A1+B1" is a formula.
update!(client::GoogleSheetsClient, range::CellRange, df::DataFrame; kwargs...)::UpdateSummaryUpdates a range of cell values in a spreadsheet.
Arguments
client::GoogleSheetsClient: client for interacting with Google Sheets.range::CellRange: cell range to modify.df::DataFrame: dataframe of values.kwargs...: keyword arguments.
GoogleSheets.clear! — Functionclear!(client::GoogleSheetsClient, range::CellRange)::UpdateSummaryClears a range of cell values in a spreadsheet.
Arguments
client::GoogleSheetsClient: clientrange::CellRange: cell range
GoogleSheets.format! — Functionformat!(client::GoogleSheetsClient, range::CellIndexRange2D, format::CellFormat)::Dict{Any,Any}Formats a range of cells.
Arguments
client::GoogleSheetsClient: client.range::CellIndexRange2D: cell index range.format::CellFormat: cell format.
GoogleSheets.format_conditional! — Functionformat_conditional!(client::GoogleSheetsClient, range::CellIndexRange2D, format::CellFormat,
condition_type::ConditionType, values...)::Dict{Any,Any}Formats a range of cells if a condition is met.
Arguments
client::GoogleSheetsClient: client.range::CellIndexRange2D: cell index range.format::CellFormat: cell format.condition_type::ConditionType: type of condition.values...: values for the condition.
GoogleSheets.format_color_gradient! — Functionformat_color_gradient!(client::GoogleSheetsClient, range::CellIndexRange2D;
min_color::Colorant=colorant"salmon", min_value_type::ValueType=VALUE_TYPE_MIN, min_value::Union{Nothing,Number}=nothing,
mid_color::Union{Nothing,Colorant}=nothing, mid_value_type::Union{Nothing,ValueType}=nothing, mid_value::Union{Nothing,Number}=nothing,
max_color::Colorant=colorant"springgreen", max_value_type::ValueType=VALUE_TYPE_MAX, max_value::Union{Nothing,Number}=nothing)::Dict{Any,Any}Sets color gradient formatting.
Arguments
client::GoogleSheetsClient: client.range::CellIndexRange2D: cell index range.min_color::Colorant=colorant"salmon": color for the minimum value.min_value_type::ValueType=VALUE_TYPE_MIN: minimum value type.min_value::Union{Nothing,Number}=nothing: minimum value.mid_color::Union{Nothing,Colorant}=nothing: color for the mid value.mid_value_type::Union{Nothing,ValueType}=nothing: mid value type.mid_value::Union{Nothing,Number}=nothing: mid value.max_color::Colorant=colorant"springgreen": color for the maximum value.max_value_type::ValueType=VALUE_TYPE_MAX: maximum value type.max_value::Union{Nothing,Number}=nothing: maximum value.
GoogleSheets.update_default_rate_limiter — Functionupdate_default_rate_limiter(rate_limiter_tokens_per_sec::Float64; rate_limiter_max_tokens::Float64=5)Update the default rate limiter.
Arguments
rate_limiter_tokens_per_sec::Float64: rate limiter number of tokens per second.rate_limiter_max_tokens::Float64=5: rate limiter max number of tokens.
update_default_rate_limiter(rate_limiter_read::AbstractRateLimiter, rate_limiter_write::AbstractRateLimiter)Update the default rate limiter.
Arguments
rate_limiter_read::AbstractRateLimiter: rate limiter for reading.rate_limiter_write::AbstractRateLimiter: rate limiter for writing.
GoogleSheets.credentials_file — Functioncredentials_file()::StringGets the credentials file needed to log into Google. The file is loaded from the GOOGLESHEETSCREDENTIALS environment variable if it is present; otherwise, it is loaded from the configuration directory, which defaults to ~/.julia/config/google_sheets/.
See the python quick start reference for a link to generate credentials. https://developers.google.com/sheets/api/quickstart/python
See the API credentials page to create or revoke credentials. https://console.developers.google.com/apis/credentials
Index
DataFrames.DataFrameGoogleSheets.AuthScopeGoogleSheets.CellFormatGoogleSheets.CellIndexRange1DGoogleSheets.CellIndexRange2DGoogleSheets.CellRangeGoogleSheets.CellRangeValuesGoogleSheets.CellRangesGoogleSheets.ConditionTypeGoogleSheets.GoogleSheetsClientGoogleSheets.NumberFormatTypeGoogleSheets.SheetGoogleSheets.SpreadsheetGoogleSheets.UpdateSummaryGoogleSheets.ValueTypeBase.append!Base.getBase.showGoogleSheets.add_sheet!GoogleSheets.batch_update!GoogleSheets.clear!GoogleSheets.credentials_fileGoogleSheets.delete_cols!GoogleSheets.delete_rows!GoogleSheets.delete_sheet!GoogleSheets.format!GoogleSheets.format_color_gradient!GoogleSheets.format_conditional!GoogleSheets.freeze!GoogleSheets.insert_cols!GoogleSheets.insert_rows!GoogleSheets.metaGoogleSheets.sheet_namesGoogleSheets.sheetsGoogleSheets.sheets_clientGoogleSheets.update!GoogleSheets.update_default_rate_limiter