yeref 0.24.91__tar.gz → 0.24.92__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.91 → yeref-0.24.92}/PKG-INFO +1 -1
- {yeref-0.24.91 → yeref-0.24.92}/setup.py +1 -1
- {yeref-0.24.91 → yeref-0.24.92}/yeref/yeref.py +37 -17
- {yeref-0.24.91 → yeref-0.24.92}/yeref.egg-info/PKG-INFO +1 -1
- {yeref-0.24.91 → yeref-0.24.92}/pyproject.toml +0 -0
- {yeref-0.24.91 → yeref-0.24.92}/setup.cfg +0 -0
- {yeref-0.24.91 → yeref-0.24.92}/yeref/__init__.py +0 -0
- {yeref-0.24.91 → yeref-0.24.92}/yeref/l_.py +0 -0
- {yeref-0.24.91 → yeref-0.24.92}/yeref/tonweb.js +0 -0
- {yeref-0.24.91 → yeref-0.24.92}/yeref.egg-info/SOURCES.txt +0 -0
- {yeref-0.24.91 → yeref-0.24.92}/yeref.egg-info/dependency_links.txt +0 -0
- {yeref-0.24.91 → yeref-0.24.92}/yeref.egg-info/top_level.txt +0 -0
@@ -16005,17 +16005,18 @@ async def calc_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16005
16005
|
))
|
16006
16006
|
print(f"gen {data_users=}")
|
16007
16007
|
|
16008
|
-
await return_activity_metrics(bot, data_users, EXTRA_D, BASE_P, data_ents, schema_name)
|
16009
|
-
await return_unit_metrics(bot, data_users, EXTRA_D, BASE_P)
|
16010
|
-
await return_cohort_metrics(bot, data_users, EXTRA_D, BASE_P)
|
16011
|
-
await return_retention_metrics(bot, data_users, EXTRA_D, BASE_P)
|
16012
|
-
await return_profit_and_loss_metrics(bot, data_users, EXTRA_D, BASE_P)
|
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, BASE_P)
|
16010
|
+
r3 = await return_cohort_metrics(bot, data_users, EXTRA_D, BASE_P)
|
16011
|
+
r4 = await return_retention_metrics(bot, data_users, EXTRA_D, BASE_P)
|
16012
|
+
r5 = await return_profit_and_loss_metrics(bot, data_users, EXTRA_D, BASE_P)
|
16013
16013
|
except Exception as e:
|
16014
16014
|
logger.info(log_ % str(e))
|
16015
16015
|
await asyncio.sleep(round(random.uniform(0, 1), 2))
|
16016
16016
|
|
16017
16017
|
|
16018
16018
|
async def return_activity_metrics(bot, data_users, EXTRA_D, BASE_P, data_ents, schema_name):
|
16019
|
+
result = None
|
16019
16020
|
try:
|
16020
16021
|
metrics_by_month = defaultdict(lambda: {
|
16021
16022
|
"dau": 0,
|
@@ -16119,14 +16120,18 @@ async def return_activity_metrics(bot, data_users, EXTRA_D, BASE_P, data_ents, s
|
|
16119
16120
|
csvfile.write(f"Unique wallet count: {len(wallets_set)}\n")
|
16120
16121
|
csvfile.write(f"Unique users count: {len(users_set)}\n")
|
16121
16122
|
|
16123
|
+
result = f_name
|
16122
16124
|
thumb = types.FSInputFile(os.path.join(EXTRA_D, 'parse.jpg'))
|
16123
16125
|
await bot.send_document(chat_id=my_tid, document=types.FSInputFile(f_name), thumbnail=thumb)
|
16124
16126
|
except Exception as e:
|
16125
16127
|
logger.info(log_ % str(e))
|
16126
16128
|
await asyncio.sleep(round(random.uniform(0, 1), 2))
|
16129
|
+
finally:
|
16130
|
+
return result
|
16127
16131
|
|
16128
16132
|
|
16129
16133
|
async def return_unit_metrics(bot, data_users, EXTRA_D):
|
16134
|
+
result = None
|
16130
16135
|
try:
|
16131
16136
|
metrics = defaultdict(lambda: {
|
16132
16137
|
"new_users": 0,
|
@@ -16211,8 +16216,8 @@ async def return_unit_metrics(bot, data_users, EXTRA_D):
|
|
16211
16216
|
"CAC": ""
|
16212
16217
|
})
|
16213
16218
|
|
16214
|
-
|
16215
|
-
with open(
|
16219
|
+
f_name = os.path.join(EXTRA_D, "2_unit_metrics.csv")
|
16220
|
+
with open(f_name, "w", newline="", encoding="utf-8") as f:
|
16216
16221
|
writer = csv.writer(f)
|
16217
16222
|
writer.writerow(["MO", "N", "MRR", "ARPU", "ARR", "ChurnR", "LTV1", "LTV2", "CMGR", "CAC"])
|
16218
16223
|
for row in results:
|
@@ -16228,14 +16233,18 @@ async def return_unit_metrics(bot, data_users, EXTRA_D):
|
|
16228
16233
|
writer.writerow([])
|
16229
16234
|
writer.writerow([f"Rev ~ ×{round(avg, 2)} monthly"])
|
16230
16235
|
|
16236
|
+
result = f_name
|
16231
16237
|
thumb = types.FSInputFile(os.path.join(EXTRA_D, "parse.jpg"))
|
16232
|
-
await bot.send_document(chat_id=my_tid, document=types.FSInputFile(
|
16238
|
+
await bot.send_document(chat_id=my_tid, document=types.FSInputFile(f_name), thumbnail=thumb)
|
16233
16239
|
except Exception as e:
|
16234
16240
|
logger.info(log_ % str(e))
|
16235
16241
|
await asyncio.sleep(round(random.uniform(0, 1), 2))
|
16242
|
+
finally:
|
16243
|
+
return result
|
16236
16244
|
|
16237
16245
|
|
16238
16246
|
async def return_cohort_metrics(bot, data_users, EXTRA_D):
|
16247
|
+
result = None
|
16239
16248
|
try:
|
16240
16249
|
cohorts = defaultdict(set)
|
16241
16250
|
activity_months = defaultdict(set)
|
@@ -16311,22 +16320,26 @@ async def return_cohort_metrics(bot, data_users, EXTRA_D):
|
|
16311
16320
|
|
16312
16321
|
avg_churn = (total_lost / total_start) if total_start else 0
|
16313
16322
|
|
16314
|
-
|
16315
|
-
with open(
|
16323
|
+
f_name = os.path.join(EXTRA_D, "3_cohort_metrics.csv")
|
16324
|
+
with open(f_name, "w", newline="", encoding="utf-8") as f:
|
16316
16325
|
writer = csv.writer(f)
|
16317
16326
|
for r in table:
|
16318
16327
|
writer.writerow(r)
|
16319
16328
|
writer.writerow([])
|
16320
16329
|
writer.writerow([f"Churn ~ ×{avg_churn:.2f} monthly"])
|
16321
16330
|
|
16331
|
+
result = f_name
|
16322
16332
|
thumb = types.FSInputFile(os.path.join(EXTRA_D, "parse.jpg"))
|
16323
|
-
await bot.send_document(chat_id=my_tid, document=types.FSInputFile(
|
16333
|
+
await bot.send_document(chat_id=my_tid, document=types.FSInputFile(f_name), thumbnail=thumb)
|
16324
16334
|
except Exception as e:
|
16325
16335
|
logger.info(log_ % str(e))
|
16326
16336
|
await asyncio.sleep(round(random.uniform(0, 1), 2))
|
16337
|
+
finally:
|
16338
|
+
return result
|
16327
16339
|
|
16328
16340
|
|
16329
16341
|
async def return_retention_metrics(bot, data_users, EXTRA_D):
|
16342
|
+
result = None
|
16330
16343
|
try:
|
16331
16344
|
rev_by_cohort = defaultdict(lambda: defaultdict(float))
|
16332
16345
|
cohort_users = defaultdict(set)
|
@@ -16366,8 +16379,8 @@ async def return_retention_metrics(bot, data_users, EXTRA_D):
|
|
16366
16379
|
num_cohorts = len(cohort_months)
|
16367
16380
|
first_cohort = cohort_months[0]
|
16368
16381
|
|
16369
|
-
|
16370
|
-
with open(
|
16382
|
+
f_name = os.path.join(EXTRA_D, "4_retention_metrics.csv")
|
16383
|
+
with open(f_name, "w", newline="", encoding="utf-8") as f:
|
16371
16384
|
writer = csv.writer(f)
|
16372
16385
|
header = ["Месяц/Когорта"] + [
|
16373
16386
|
f"{c} ({len(cohort_users[c])})" for c in cohort_months
|
@@ -16407,14 +16420,18 @@ async def return_retention_metrics(bot, data_users, EXTRA_D):
|
|
16407
16420
|
writer.writerow([])
|
16408
16421
|
writer.writerow([f"NRR ~ ×{avg_multiplier:.2f} monthly"])
|
16409
16422
|
|
16423
|
+
result = f_name
|
16410
16424
|
thumb = types.FSInputFile(os.path.join(EXTRA_D, "parse.jpg"))
|
16411
|
-
await bot.send_document(chat_id=my_tid, document=types.FSInputFile(
|
16425
|
+
await bot.send_document(chat_id=my_tid, document=types.FSInputFile(f_name), thumbnail=thumb)
|
16412
16426
|
except Exception as e:
|
16413
16427
|
logger.info(log_ % str(e))
|
16414
16428
|
await asyncio.sleep(round(random.uniform(0, 1), 2))
|
16429
|
+
finally:
|
16430
|
+
return result
|
16415
16431
|
|
16416
16432
|
|
16417
16433
|
async def return_profit_and_loss_metrics(bot, data_users, EXTRA_D):
|
16434
|
+
result = None
|
16418
16435
|
try:
|
16419
16436
|
metrics = defaultdict(lambda: {"sum_amount": 0.0})
|
16420
16437
|
|
@@ -16461,8 +16478,8 @@ async def return_profit_and_loss_metrics(bot, data_users, EXTRA_D):
|
|
16461
16478
|
fmt(NP)
|
16462
16479
|
])
|
16463
16480
|
|
16464
|
-
|
16465
|
-
with open(
|
16481
|
+
f_name = os.path.join(EXTRA_D, "5_profit_and_loss_metrics.csv")
|
16482
|
+
with open(f_name, "w", newline="", encoding="utf-8") as f:
|
16466
16483
|
writer = csv.writer(f)
|
16467
16484
|
writer.writerow([
|
16468
16485
|
"Mo", "MRR", "COGS", "Gross Profit",
|
@@ -16471,11 +16488,14 @@ async def return_profit_and_loss_metrics(bot, data_users, EXTRA_D):
|
|
16471
16488
|
for row in results:
|
16472
16489
|
writer.writerow(row)
|
16473
16490
|
|
16491
|
+
result = f_name
|
16474
16492
|
thumb = types.FSInputFile(os.path.join(EXTRA_D, "parse.jpg"))
|
16475
|
-
await bot.send_document(chat_id=my_tid, document=types.FSInputFile(
|
16493
|
+
await bot.send_document(chat_id=my_tid, document=types.FSInputFile(f_name), thumbnail=thumb)
|
16476
16494
|
except Exception as e:
|
16477
16495
|
logger.info(log_ % str(e))
|
16478
16496
|
await asyncio.sleep(round(random.uniform(0, 1), 2))
|
16497
|
+
finally:
|
16498
|
+
return result
|
16479
16499
|
# endregion
|
16480
16500
|
|
16481
16501
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|