yeref 0.24.66__py3-none-any.whl → 0.24.67__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
@@ -16241,6 +16241,70 @@ async def return_cohort_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
16241
16241
  cohorts = defaultdict(set)
16242
16242
  activity_months = defaultdict(set)
16243
16243
 
16244
+ months = ["2025-06", "2025-07", "2025-08", "2025-09"]
16245
+ data_users = []
16246
+ for _ in range(20):
16247
+ # дата входа
16248
+ entry_month = random.choice(months)
16249
+ entry_day = random.randint(1, 28)
16250
+ entry_date = f"{entry_month}-{entry_day:02}"
16251
+ entry_dt_obj = datetime.strptime(entry_date, '%Y-%m-%d')
16252
+ entry_dt = f"{entry_dt_obj.strftime('%d-%m-%Y')}_{datetime.now().strftime('%H-%M-%S')}"
16253
+ utm = random.choice(["/start", "/startapp"])
16254
+
16255
+ # месяцы от входа и дальше
16256
+ valid_months = [m for m in months if datetime.strptime(m + "-01", "%Y-%m-%d") >= entry_dt_obj.replace(day=1)]
16257
+ if not valid_months:
16258
+ valid_months = [entry_month]
16259
+
16260
+ user_mau = sorted(random.sample(valid_months, k=random.randint(1, len(valid_months))))
16261
+ user_dau_dates = set()
16262
+ txs, payments = [], []
16263
+
16264
+ # платеж
16265
+ if user_mau:
16266
+ pay_month = random.choice(user_mau)
16267
+ pay_day = random.randint(1, 28)
16268
+ pay_date = f"{pay_month}-{pay_day:02}"
16269
+ dt_pay = datetime.strptime(pay_date, "%Y-%m-%d")
16270
+ # if dt_pay >= entry_dt_obj:
16271
+ payments = [{
16272
+ "TYPE": random.choice(["don", "sub", "pst"]),
16273
+ "DT_START": f"{dt_pay.strftime('%d-%m-%Y')}_14-00-00",
16274
+ "DT_END": "0",
16275
+ "AMOUNT": str(random.randint(1, 10))
16276
+ }]
16277
+ user_dau_dates.add(pay_date)
16278
+
16279
+ # вход в приложение
16280
+ user_dau_dates.add(entry_date)
16281
+ for m in user_mau:
16282
+ day = random.randint(1, 28)
16283
+ visit = f"{m}-{day:02}"
16284
+ dt_visit = datetime.strptime(visit, "%Y-%m-%d")
16285
+ if dt_visit >= entry_dt_obj and random.random() < 0.7:
16286
+ user_dau_dates.add(visit)
16287
+
16288
+ # статусы (отток) с низкой вероятностью
16289
+ USER_STATUSES = []
16290
+ if random.random() < 0.2: # 10% шанс оттока
16291
+ churn_month = random.choice(valid_months)
16292
+ churn_day = random.randint(1, 28)
16293
+ churn_date = f"{churn_month}-{churn_day:02}"
16294
+ churn_ts = datetime.strptime(churn_date, "%Y-%m-%d").strftime("%d-%m-%Y") + "_23-59-59"
16295
+ USER_STATUSES = [{random.choice(["left", "kicked"]): churn_ts}]
16296
+
16297
+ user_dau = sorted(user_dau_dates)
16298
+ wallet = f"wallet{random.randint(1, 100)}" if txs else random.choice([f"wallet{random.randint(1, 100)}", ""])
16299
+
16300
+ data_users.append((
16301
+ random.randint(100000, 999999),
16302
+ json.dumps({"USER_WALLET": wallet, "USER_UTM": utm, "USER_DT": entry_dt}),
16303
+ json.dumps({"USER_DAU": user_dau, "USER_MAU": user_mau, "USER_TXS": txs,
16304
+ "USER_PAYMENTS": payments, "USER_STATUSES": USER_STATUSES})
16305
+ ))
16306
+ print(f"gen {data_users=}")
16307
+
16244
16308
  for USER_TID, USER_VARS, USER_LSTS in data_users:
16245
16309
  USER_VARS = json.loads(USER_VARS or "{}")
16246
16310
  USER_LSTS = json.loads(USER_LSTS or "{}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yeref
3
- Version: 0.24.66
3
+ Version: 0.24.67
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=LMX_olmJwq-tgoALJCnhV_fGrL_i_43yBLkLIcEVqGo,1176743
3
+ yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
4
+ yeref/yeref.py,sha256=rVaQc_Ol1gmoBs8HxywCSu--0yxBYRZzgDiNAp6MGE8,1052940
5
+ yeref-0.24.67.dist-info/METADATA,sha256=0Knh7gq-jz47tplBHpMdEYsEPZogwk3Wf1Bg6BXAQrA,119
6
+ yeref-0.24.67.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ yeref-0.24.67.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
8
+ yeref-0.24.67.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
2
- yeref/l_.py,sha256=LMX_olmJwq-tgoALJCnhV_fGrL_i_43yBLkLIcEVqGo,1176743
3
- yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
4
- yeref/yeref.py,sha256=jPkWUJXO_GvUGd6SXXRnAhGNr_G0snlu5NoCgvOyI5Q,1049848
5
- yeref-0.24.66.dist-info/METADATA,sha256=GWW789HTQT4WP3uucPD8e7cSrrUpekFvWNjSqHXdwcg,119
6
- yeref-0.24.66.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- yeref-0.24.66.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
8
- yeref-0.24.66.dist-info/RECORD,,