yeref 0.29.29__py3-none-any.whl → 0.29.30__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.
yeref/yeref.py CHANGED
@@ -18890,6 +18890,24 @@ async def set_privacy(app):
18890
18890
 
18891
18891
 
18892
18892
  # region google
18893
+ async def normalize_rows(rows):
18894
+ out = []
18895
+ for row in rows:
18896
+ new_row = []
18897
+ iterable = row.values() if hasattr(row, "values") else row
18898
+ for c in iterable:
18899
+ if isinstance(c, datetime.datetime):
18900
+ new_row.append(c.isoformat())
18901
+ elif isinstance(c, (dict, list)):
18902
+ new_row.append(json.dumps(c, ensure_ascii=False))
18903
+ elif c is None:
18904
+ new_row.append("")
18905
+ else:
18906
+ new_row.append(str(c))
18907
+ out.append(new_row)
18908
+ return out
18909
+
18910
+
18893
18911
  async def api_sync_all(value_many, spreadsheet_id, CONF_P, EXTRA_D, range_many='A2', sheet_id='Sheet1',
18894
18912
  value_input_option='USER_ENTERED', major_dimension="ROWS"):
18895
18913
  scopes = r_conf('scopes', CONF_P)
@@ -18898,12 +18916,23 @@ async def api_sync_all(value_many, spreadsheet_id, CONF_P, EXTRA_D, range_many='
18898
18916
  http_auth = credentials.authorize(httplib2.Http())
18899
18917
  sheets_service = build('sheets', 'v4', http=http_auth, cache_discovery=False)
18900
18918
 
18901
- convert_value = []
18902
- for item in value_many:
18903
- convert_value.append(list(item))
18904
-
18905
- await api_write_cells(sheets_service, convert_value, range_many, spreadsheet_id, sheet_id, value_input_option,
18906
- major_dimension)
18919
+ # convert_value = []
18920
+ # for item in value_many:
18921
+ # convert_value.append(list(item))
18922
+ #
18923
+ # await api_write_cells(sheets_service, convert_value, range_many, spreadsheet_id, sheet_id, value_input_option, major_dimension)
18924
+ prepared = await normalize_rows([list(item) for item in value_many])
18925
+ # print(f"{convert_value=}")
18926
+
18927
+ await api_write_cells(
18928
+ sheets_service,
18929
+ convert_value,
18930
+ range_many,
18931
+ spreadsheet_id,
18932
+ sheet_id,
18933
+ value_input_option,
18934
+ major_dimension
18935
+ )
18907
18936
 
18908
18937
 
18909
18938
  async def api_sync_update(value_many, spreadsheet_id, range_many, CONF_P, EXTRA_D, sheet_id='Sheet1',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yeref
3
- Version: 0.29.29
3
+ Version: 0.29.30
4
4
  Summary: desc-f
5
5
  Author: john smith
6
6
  Dynamic: author
@@ -0,0 +1,8 @@
1
+ yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
2
+ yeref/l_.py,sha256=RbirKXasMmKTniXrvC08hF2DVfuHg-s75Z8pliEkEZk,616929
3
+ yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
4
+ yeref/yeref.py,sha256=8jarf3k95P1m1hvljunQDeQPGah3cAXgPlmHr6Bk8j4,1048853
5
+ yeref-0.29.30.dist-info/METADATA,sha256=vsompAIEKBavM4RrUG5PQjO3R6VG5Hyu_Do-fiFZ26o,119
6
+ yeref-0.29.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ yeref-0.29.30.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
8
+ yeref-0.29.30.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
2
- yeref/l_.py,sha256=RbirKXasMmKTniXrvC08hF2DVfuHg-s75Z8pliEkEZk,616929
3
- yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
4
- yeref/yeref.py,sha256=Rnouun6f2Tl59b9EQb0nKNmdiPY6zH64OtZxJGRSIJI,1048012
5
- yeref-0.29.29.dist-info/METADATA,sha256=BrznGbBQPR-llPgETVF3hahmliX9he-VansT7P-rbTU,119
6
- yeref-0.29.29.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- yeref-0.29.29.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
8
- yeref-0.29.29.dist-info/RECORD,,