yeref 0.24.71__tar.gz → 0.24.72__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: yeref
3
- Version: 0.24.71
3
+ Version: 0.24.72
4
4
  Summary: desc-f
5
5
  Author: john smith
6
6
  Dynamic: author
@@ -2,7 +2,7 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name='yeref',
5
- version='0.24.71',
5
+ version='0.24.72',
6
6
  description='desc-f',
7
7
  author='john smith',
8
8
  packages=['yeref'],
@@ -16405,6 +16405,70 @@ async def return_retention_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
16405
16405
  sql = 'SELECT USER_TID, USER_VARS, USER_LSTS FROM "USER"'
16406
16406
  data_users = await db_select_pg(sql, (), BASE_P)
16407
16407
 
16408
+ months = ["2025-06", "2025-07", "2025-08", "2025-09"]
16409
+ data_users = []
16410
+ for _ in range(30):
16411
+ # дата входа
16412
+ entry_month = random.choice(months)
16413
+ entry_day = random.randint(1, 28)
16414
+ entry_date = f"{entry_month}-{entry_day:02}"
16415
+ entry_dt_obj = datetime.strptime(entry_date, '%Y-%m-%d')
16416
+ entry_dt = f"{entry_dt_obj.strftime('%d-%m-%Y')}_{datetime.now().strftime('%H-%M-%S')}"
16417
+ utm = random.choice(["/start", "/startapp"])
16418
+
16419
+ # месяцы от входа и дальше
16420
+ valid_months = [m for m in months if datetime.strptime(m + "-01", "%Y-%m-%d") >= entry_dt_obj.replace(day=1)]
16421
+ if not valid_months:
16422
+ valid_months = [entry_month]
16423
+
16424
+ user_mau = sorted(random.sample(valid_months, k=random.randint(1, len(valid_months))))
16425
+ user_dau_dates = set()
16426
+ txs, payments = [], []
16427
+
16428
+ # платеж
16429
+ if user_mau:
16430
+ pay_month = random.choice(user_mau)
16431
+ pay_day = random.randint(1, 28)
16432
+ pay_date = f"{pay_month}-{pay_day:02}"
16433
+ dt_pay = datetime.strptime(pay_date, "%Y-%m-%d")
16434
+ # if dt_pay >= entry_dt_obj:
16435
+ payments = [{
16436
+ "TYPE": random.choice(["don", "sub", "pst"]),
16437
+ "DT_START": f"{dt_pay.strftime('%d-%m-%Y')}_14-00-00",
16438
+ "DT_END": "0",
16439
+ "AMOUNT": str(random.randint(1, 10))
16440
+ }]
16441
+ user_dau_dates.add(pay_date)
16442
+
16443
+ # вход в приложение
16444
+ user_dau_dates.add(entry_date)
16445
+ for m in user_mau:
16446
+ day = random.randint(1, 28)
16447
+ visit = f"{m}-{day:02}"
16448
+ dt_visit = datetime.strptime(visit, "%Y-%m-%d")
16449
+ if dt_visit >= entry_dt_obj and random.random() < 0.7:
16450
+ user_dau_dates.add(visit)
16451
+
16452
+ # статусы (отток) с низкой вероятностью
16453
+ USER_STATUSES = []
16454
+ if random.random() < 0.2: # 10% шанс оттока
16455
+ churn_month = random.choice(valid_months)
16456
+ churn_day = random.randint(1, 28)
16457
+ churn_date = f"{churn_month}-{churn_day:02}"
16458
+ churn_ts = datetime.strptime(churn_date, "%Y-%m-%d").strftime("%d-%m-%Y") + "_23-59-59"
16459
+ USER_STATUSES = [{random.choice(["left", "kicked"]): churn_ts}]
16460
+
16461
+ user_dau = sorted(user_dau_dates)
16462
+ wallet = f"wallet{random.randint(1, 100)}" if txs else random.choice([f"wallet{random.randint(1, 100)}", ""])
16463
+
16464
+ data_users.append((
16465
+ random.randint(100000, 999999),
16466
+ json.dumps({"USER_WALLET": wallet, "USER_UTM": utm, "USER_DT": entry_dt}),
16467
+ json.dumps({"USER_DAU": user_dau, "USER_MAU": user_mau, "USER_TXS": txs,
16468
+ "USER_PAYMENTS": payments, "USER_STATUSES": USER_STATUSES})
16469
+ ))
16470
+ print(f"gen {data_users=}")
16471
+
16408
16472
  rev_by_cohort = defaultdict(lambda: defaultdict(float))
16409
16473
  cohort_users = defaultdict(set)
16410
16474
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yeref
3
- Version: 0.24.71
3
+ Version: 0.24.72
4
4
  Summary: desc-f
5
5
  Author: john smith
6
6
  Dynamic: author
File without changes
File without changes
File without changes
File without changes
File without changes