autodrive.dtypes
¶
Module Contents¶
Classes¶
String datatype, covers all non-numeric/date text that isn’t a formula. |
|
Formula datatype, essentially a string, but begins with =. |
|
Number datatype, covers both floats and integers, though internally Number is |
|
Boolean datatype, appears in Google Sheets as FALSE or TRUE. |
|
Metaclass for the three different ways values are stored in Google Sheets. |
|
UserEnteredVal is the value as entered by the user, without any calculations |
|
EffectiveVal is the value as displayed in Google Sheets, and is appropriately |
|
The untyped string value of the cell as displayed in Google Sheets. Essentially |
|
The formatting properties the user as applied to the cell. |
|
The final dictionary of formatting information about a cell and its values, |
|
The default formatting properties of a cell, dictated by the settings of the |
Attributes¶
A tuple of UserEnteredVal, EffectiveVal, and FormattedVal google value types. |
|
A tuple of String, Formula, Number, and Boolean google data types. |
|
Dictionary mapping python data types to corresponding google data types. |
|
Dictionary mapping google data types to corresponding python types. |
- class autodrive.dtypes.String¶
String datatype, covers all non-numeric/date text that isn’t a formula.
- python_type¶
- type_key = stringValue¶
- classmethod parse(cls, value)¶
Converts a string into a string.
- Parameters
value (str) – Any string.
- Returns
The passed value as a string.
- Return type
str
- class autodrive.dtypes.Formula¶
Formula datatype, essentially a string, but begins with =.
- python_type¶
- type_key = formulaValue¶
- classmethod parse(cls, value)¶
Converts a string into a formula (string).
- Parameters
value (str) – Any string.
- Returns
The passed value as a string.
- Return type
str
- class autodrive.dtypes.Number¶
Number datatype, covers both floats and integers, though internally Number is treated as a float so as to not lose significant digits.
- python_type¶
- type_key = numberValue¶
- classmethod parse(cls, value)¶
Converts a string into an integer (if it has no decimal point) or float.
- Parameters
value (str) – Any numeric string.
- Returns
The passed value as an integer or float.
- Return type
float | int
- class autodrive.dtypes.Boolean¶
Boolean datatype, appears in Google Sheets as FALSE or TRUE.
- python_type¶
- type_key = boolValue¶
- classmethod parse(cls, value)¶
Converts a string into a boolean.
- Parameters
value (str) – Any string.
- Returns
False if the string is some variation of FALSE, otherwise True for all other strings.
- Return type
bool
- class autodrive.dtypes.GoogleValueType¶
Metaclass for the three different ways values are stored in Google Sheets.
- value_key :str¶
The API key for the GoogleValueType.
- has_dtype :bool = True¶
Whether dtype information can be extracted from the GoogleValueType.
- class autodrive.dtypes.UserEnteredVal¶
UserEnteredVal is the value as entered by the user, without any calculations applied to it. It is always a string, but is accompanied by metadata that indicates what datatype the value is.
- value_key = userEnteredValue¶
- class autodrive.dtypes.EffectiveVal¶
EffectiveVal is the value as displayed in Google Sheets, and is appropriately typed when read from the api. So if the formula “=A1+A2” would equal 3, then the EffectiveVal of that cell is 3.
- value_key = effectiveValue¶
- class autodrive.dtypes.FormattedVal¶
The untyped string value of the cell as displayed in Google Sheets. Essentially equivalent to EffectiveVal, but without appropriate typing.
- value_key = formattedValue¶
- has_dtype = False¶
- autodrive.dtypes.GOOGLE_VAL_TYPES¶
A tuple of UserEnteredVal, EffectiveVal, and FormattedVal google value types.
- autodrive.dtypes.GOOGLE_DTYPES¶
A tuple of String, Formula, Number, and Boolean google data types.
- autodrive.dtypes.TYPE_MAP¶
Dictionary mapping python data types to corresponding google data types.
- autodrive.dtypes.REV_TYPE_MAP¶
Dictionary mapping google data types to corresponding python types.
- class autodrive.dtypes.UserEnteredFmt¶
The formatting properties the user as applied to the cell.
- format_key = userEnteredFormat¶