how to read a syntax diagram

Paul tallpaul at gmail.com
Sun May 27 17:17:57 EDT 2018


hi,
   I'm using the Google Sheets API (the client library rather than the
RESTful interface) and I'm confused about the meaning of the syntax
diagrams.  This is from
https://developers.google.com/resources/api-libraries/documentation/sheets/v4/python/latest/sheets_v4.spreadsheets.values.html#update

efaults to ROWS.
  }

update(spreadsheetId=*, range=*, body=*, valueInputOption=None,
x__xgafv=None, responseValueRenderOption=None,
includeValuesInResponse=None, responseDateTimeRenderOption=None)

Sets values in a range of a spreadsheet.
The caller must specify the spreadsheet ID, range, and
a valueInputOption.

Args:
  spreadsheetId: string, The ID of the spreadsheet to update. (required)
  range: string, The A1 notation of the values to update. (required)
  body: object, The request body. (required)
    The object takes the form of:

{ # Data within a range of the spreadsheet.
  "range": "A String", # The range the values cover, in A1 notation.
      # For output, this range indicates the entire requested range,
      # even though the values will exclude trailing rows and columns.
      # When appending values, this field represents the range to search for a
      # table, after which values will be appended.
  "values": [ # The data that was read or to be written.  This is an
array of arrays,
      # the outer array representing all the data and each inner array
      # representing a major dimension. Each item in the inner array
      # corresponds with one cell.
      #
      # For output, empty trailing rows and columns will not be included.
      #
      # For input, supported value types are: bool, string, and double.
      # Null values will be skipped.
      # To set a cell to an empty value, set the string value to an
empty string.
    [
      "",
    ],
  ],
  "majorDimension": "A String", # The major dimension of the values.
      #
      # For output, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`,
      # then requesting `range=A1:B2,majorDimension=ROWS` will return
      # `[[1,2],[3,4]]`,
      # whereas requesting `range=A1:B2,majorDimension=COLUMNS` will return
      # `[[1,3],[2,4]]`.
      #
      # For input, with `range=A1:B2,majorDimension=ROWS` then `[[1,2],[3,4]]`
      # will set `A1=1,B1=2,A2=3,B2=4`. With
`range=A1:B2,majorDimension=COLUMNS`
      # then `[[1,2],[3,4]]` will set `A1=1,B1=3,A2=2,B2=4`.
      #
      # When writing, if this field is not set, it defaults to ROWS.
}

  valueInputOption: string, How the input data should be
interpreted....// I CUT IT OFF, HERE


My specific questions are:
   1) is this standard (python?) syntax notation?  I haven't found a key to
this form of documentation.
   1)  What does  '=*' mean?
   2)  What does '=None' mean?    [my guess is that this means "no default
value"].
   3)  Note that it says that range is required.  Through trial, I see that
*one* of the 'range' specifications is required.  I.E., I can specify
'range' outside body, or 'range' as part of body, or both, but I must have
'range' someplace.   This is a bit confusing to me ( as opposed to my usual
understanding of "required").  Also, what does range mean, in these two
different spots, and what does it mean if two different values of range are
specified?

thanks
  Paul Czyzewski



More information about the Python-list mailing list