smartsheet-tools 0.0.4__py3-none-any.whl → 0.0.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- smartsheet_tools/__init__.py +7 -5
- {smartsheet_tools-0.0.4.dist-info → smartsheet_tools-0.0.6.dist-info}/METADATA +1 -1
- smartsheet_tools-0.0.6.dist-info/RECORD +6 -0
- smartsheet_tools-0.0.4.dist-info/RECORD +0 -6
- {smartsheet_tools-0.0.4.dist-info → smartsheet_tools-0.0.6.dist-info}/WHEEL +0 -0
- {smartsheet_tools-0.0.4.dist-info → smartsheet_tools-0.0.6.dist-info}/licenses/LICENSE +0 -0
- {smartsheet_tools-0.0.4.dist-info → smartsheet_tools-0.0.6.dist-info}/top_level.txt +0 -0
smartsheet_tools/__init__.py
CHANGED
|
@@ -55,17 +55,20 @@ def standard_time_to_isoformat(st):
|
|
|
55
55
|
return None
|
|
56
56
|
return datetime_to_isoformat(datetime.strptime(st, "%m/%d/%Y"))
|
|
57
57
|
|
|
58
|
-
def get_cached_column_type(column_id, sheet_obj):
|
|
58
|
+
def get_cached_column_type(column_id, sheet_obj, prefill=False):
|
|
59
59
|
if sheet_obj.id not in _COLUMN_TYPE_CACHE:
|
|
60
60
|
_COLUMN_TYPE_CACHE[sheet_obj.id] = {}
|
|
61
61
|
|
|
62
62
|
if column_id not in _COLUMN_TYPE_CACHE[sheet_obj.id]:
|
|
63
|
-
|
|
63
|
+
if not prefill:
|
|
64
|
+
_COLUMN_TYPE_CACHE[sheet_obj.id][column_id] = str(sheet_obj.get_column(column_id).type)
|
|
65
|
+
else:
|
|
66
|
+
_COLUMN_TYPE_CACHE[sheet_obj.id][column_id] = prefill
|
|
64
67
|
|
|
65
68
|
return _COLUMN_TYPE_CACHE[sheet_obj.id][column_id]
|
|
66
69
|
|
|
67
70
|
def get_col_names_of_date_cols(sheet_obj):
|
|
68
|
-
return [c.title for c in sheet_obj.columns if get_cached_column_type(c.id, sheet_obj) in ("DATE", "DATETIME")]
|
|
71
|
+
return [c.title for c in sheet_obj.columns if get_cached_column_type(c.id, sheet_obj, prefill=c.type) in ("DATE", "DATETIME")]
|
|
69
72
|
|
|
70
73
|
def brute_force_date_string(s, nonetype_if_fail=False):
|
|
71
74
|
# attempt to parse a date string in common formats to ISO 8601
|
|
@@ -107,8 +110,7 @@ def new_cell(column_id=None, value=None, strict=False, formula=None):
|
|
|
107
110
|
new_cell.formula = formula
|
|
108
111
|
else:
|
|
109
112
|
new_cell.value = value
|
|
110
|
-
|
|
111
|
-
new_cell.strict = True
|
|
113
|
+
new_cell.strict = strict
|
|
112
114
|
return new_cell
|
|
113
115
|
|
|
114
116
|
def new_row(cells=None, id=None, parent_id=None, to_top=False, locked=False):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: smartsheet_tools
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Summary: A collection of convenience functions to aid with transitioning from simple-smartsheet to the SDK API and common tasks
|
|
5
5
|
Author: Ashton Pooley
|
|
6
6
|
Author-email: Ashton Pooley <ashton@ashi.digital>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
smartsheet_tools/__init__.py,sha256=LVm1iRzWDUnvORe0gaJWVYlOS_-7LER1zbhJG3828Q8,6544
|
|
2
|
+
smartsheet_tools-0.0.6.dist-info/licenses/LICENSE,sha256=xshMXNQ83e1x1bG3-9fQ5U8hnMaJsv79ke3xuKmI2PI,31914
|
|
3
|
+
smartsheet_tools-0.0.6.dist-info/METADATA,sha256=RhltbsXCVgmWiJR0xEVzQ0NQD74c1Bg2_4BGOgGCmzE,834
|
|
4
|
+
smartsheet_tools-0.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
5
|
+
smartsheet_tools-0.0.6.dist-info/top_level.txt,sha256=UXKUTK6mn1resx7hDN-MqSLi6ZnojUbkJ44VzmNmYi8,17
|
|
6
|
+
smartsheet_tools-0.0.6.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
smartsheet_tools/__init__.py,sha256=CENQb8WEHEa1pPCISbdBRQyZbJWmv9IIUFrJuaeAP4w,6420
|
|
2
|
-
smartsheet_tools-0.0.4.dist-info/licenses/LICENSE,sha256=xshMXNQ83e1x1bG3-9fQ5U8hnMaJsv79ke3xuKmI2PI,31914
|
|
3
|
-
smartsheet_tools-0.0.4.dist-info/METADATA,sha256=8QOUTdU3lqlThmuzOvNOMxw1PAXb2EhzJ7z0dbLkk50,834
|
|
4
|
-
smartsheet_tools-0.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
5
|
-
smartsheet_tools-0.0.4.dist-info/top_level.txt,sha256=UXKUTK6mn1resx7hDN-MqSLi6ZnojUbkJ44VzmNmYi8,17
|
|
6
|
-
smartsheet_tools-0.0.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|