smartsheet-tools 0.0.5__tar.gz → 0.0.6__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: smartsheet_tools
3
- Version: 0.0.5
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>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "smartsheet_tools" # from setup.py
7
- version = "0.0.5" # from setup.py
7
+ version = "0.0.6" # from setup.py
8
8
  description = "A collection of convenience functions to aid with transitioning from simple-smartsheet to the SDK API and common tasks"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9" # matches classifiers (3.9–3.12)
@@ -2,7 +2,7 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name="smartsheet_tools",
5
- version="0.0.5",
5
+ version="0.0.6",
6
6
  description="A collection of convenience functions to aid with transitioning from simple-smartsheet to the SDK API and common tasks",
7
7
  author="Ashton Pooley",
8
8
  author_email="Ashton@ashi.digital",
@@ -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
- _COLUMN_TYPE_CACHE[sheet_obj.id][column_id] = str(sheet_obj.get_column(column_id).type)
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: smartsheet_tools
3
- Version: 0.0.5
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>