yeref 0.24.93__tar.gz → 0.24.95__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.
- {yeref-0.24.93 → yeref-0.24.95}/PKG-INFO +1 -1
- {yeref-0.24.93 → yeref-0.24.95}/setup.py +1 -1
- {yeref-0.24.93 → yeref-0.24.95}/yeref/yeref.py +30 -5
- {yeref-0.24.93 → yeref-0.24.95}/yeref.egg-info/PKG-INFO +1 -1
- {yeref-0.24.93 → yeref-0.24.95}/pyproject.toml +0 -0
- {yeref-0.24.93 → yeref-0.24.95}/setup.cfg +0 -0
- {yeref-0.24.93 → yeref-0.24.95}/yeref/__init__.py +0 -0
- {yeref-0.24.93 → yeref-0.24.95}/yeref/l_.py +0 -0
- {yeref-0.24.93 → yeref-0.24.95}/yeref/tonweb.js +0 -0
- {yeref-0.24.93 → yeref-0.24.95}/yeref.egg-info/SOURCES.txt +0 -0
- {yeref-0.24.93 → yeref-0.24.95}/yeref.egg-info/dependency_links.txt +0 -0
- {yeref-0.24.93 → yeref-0.24.95}/yeref.egg-info/top_level.txt +0 -0
@@ -15926,7 +15926,7 @@ async def upd_user_data(ENT_TID, data, web_app_init_data, PROJECT_USERNAME, BASE
|
|
15926
15926
|
|
15927
15927
|
|
15928
15928
|
# region unit ecomonics
|
15929
|
-
async def calc_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
15929
|
+
async def calc_metrics(bot, PROJECT_USERNAME, dataroom_folder_id, EXTRA_D, BASE_P, CONF_P):
|
15930
15930
|
try:
|
15931
15931
|
schema_name = "USER"
|
15932
15932
|
if PROJECT_USERNAME == 'FereyBotBot':
|
@@ -16006,10 +16006,35 @@ async def calc_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16006
16006
|
print(f"gen {data_users=}")
|
16007
16007
|
|
16008
16008
|
r1 = await return_activity_metrics(bot, data_users, EXTRA_D, BASE_P, data_ents, schema_name)
|
16009
|
-
r2 = await return_unit_metrics(bot, data_users, EXTRA_D
|
16010
|
-
r3 = await return_cohort_metrics(bot, data_users, EXTRA_D
|
16011
|
-
r4 = await return_retention_metrics(bot, data_users, EXTRA_D
|
16012
|
-
r5 = await return_profit_and_loss_metrics(bot, data_users, EXTRA_D
|
16009
|
+
r2 = await return_unit_metrics(bot, data_users, EXTRA_D)
|
16010
|
+
r3 = await return_cohort_metrics(bot, data_users, EXTRA_D)
|
16011
|
+
r4 = await return_retention_metrics(bot, data_users, EXTRA_D)
|
16012
|
+
r5 = await return_profit_and_loss_metrics(bot, data_users, EXTRA_D)
|
16013
|
+
|
16014
|
+
# === НОВЫЙ БЛОК: читаем CSV (r1) и заливаем его в Google Sheets ===
|
16015
|
+
if r1 and os.path.isfile(r1):
|
16016
|
+
# 1) читаем весь CSV в память как список списков (каждая строка ― это список полей)
|
16017
|
+
with open(r1, newline='', encoding='utf-8') as csvfile:
|
16018
|
+
reader = csv.reader(csvfile)
|
16019
|
+
all_rows = list(reader)
|
16020
|
+
|
16021
|
+
# 2) вызываем api_sync_all:
|
16022
|
+
# передаём all_rows, ID вашей «цельной» таблицы (dataroom_folder_id), CONF_P и EXTRA_D
|
16023
|
+
# (можно опционно прокинуть range_many и sheet_id, если нужно не с «A2»).
|
16024
|
+
# По умолчанию api_sync_all запишет значения в диапазон A2:… для листа Sheet1.
|
16025
|
+
await api_sync_all(
|
16026
|
+
all_rows,
|
16027
|
+
dataroom_folder_id, # используем именно этот ID
|
16028
|
+
CONF_P,
|
16029
|
+
EXTRA_D,
|
16030
|
+
range_many='A1', # если вы хотите записать вместе с заголовком (из CSV)
|
16031
|
+
sheet_id='Sheet1', # можно заменить на нужное имя листа
|
16032
|
+
value_input_option='USER_ENTERED',
|
16033
|
+
major_dimension='ROWS'
|
16034
|
+
)
|
16035
|
+
logger.info("Activity‐метрики успешно залиты в Google‐таблицу.")
|
16036
|
+
else:
|
16037
|
+
logger.warning(f"Не удалось найти файл {r1} для загрузки в Google Sheets.")
|
16013
16038
|
except Exception as e:
|
16014
16039
|
logger.info(log_ % str(e))
|
16015
16040
|
await asyncio.sleep(round(random.uniform(0, 1), 2))
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|