yeref 0.24.61__tar.gz → 0.24.62__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.61
3
+ Version: 0.24.62
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.61',
5
+ version='0.24.62',
6
6
  description='desc-f',
7
7
  author='john smith',
8
8
  packages=['yeref'],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yeref
3
- Version: 0.24.61
3
+ Version: 0.24.62
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
@@ -16135,70 +16135,6 @@ async def return_unit_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
16135
16135
  })
16136
16136
  seen_new = set()
16137
16137
 
16138
- months = ["2025-06", "2025-07", "2025-08", "2025-09"]
16139
- data_users = []
16140
- for _ in range(20):
16141
- # дата входа
16142
- entry_month = random.choice(months)
16143
- entry_day = random.randint(1, 28)
16144
- entry_date = f"{entry_month}-{entry_day:02}"
16145
- entry_dt_obj = datetime.strptime(entry_date, '%Y-%m-%d')
16146
- entry_dt = f"{entry_dt_obj.strftime('%d-%m-%Y')}_{datetime.now().strftime('%H-%M-%S')}"
16147
- utm = random.choice(["/start", "/startapp"])
16148
-
16149
- # месяцы от входа и дальше
16150
- valid_months = [m for m in months if datetime.strptime(m + "-01", "%Y-%m-%d") >= entry_dt_obj.replace(day=1)]
16151
- if not valid_months:
16152
- valid_months = [entry_month]
16153
-
16154
- user_mau = sorted(random.sample(valid_months, k=random.randint(1, len(valid_months))))
16155
- user_dau_dates = set()
16156
- txs, payments = [], []
16157
-
16158
- # платеж
16159
- if user_mau:
16160
- pay_month = random.choice(user_mau)
16161
- pay_day = random.randint(1, 28)
16162
- pay_date = f"{pay_month}-{pay_day:02}"
16163
- dt_pay = datetime.strptime(pay_date, "%Y-%m-%d")
16164
- # if dt_pay >= entry_dt_obj:
16165
- payments = [{
16166
- "TYPE": random.choice(["don", "sub", "pst"]),
16167
- "DT_START": f"{dt_pay.strftime('%d-%m-%Y')}_14-00-00",
16168
- "DT_END": "0",
16169
- "AMOUNT": str(random.randint(1, 10))
16170
- }]
16171
- user_dau_dates.add(pay_date)
16172
-
16173
- # вход в приложение
16174
- user_dau_dates.add(entry_date)
16175
- for m in user_mau:
16176
- day = random.randint(1, 28)
16177
- visit = f"{m}-{day:02}"
16178
- dt_visit = datetime.strptime(visit, "%Y-%m-%d")
16179
- if dt_visit >= entry_dt_obj and random.random() < 0.7:
16180
- user_dau_dates.add(visit)
16181
-
16182
- # статусы (отток) с низкой вероятностью
16183
- USER_STATUSES = []
16184
- if random.random() < 0.2: # 10% шанс оттока
16185
- churn_month = random.choice(valid_months)
16186
- churn_day = random.randint(1, 28)
16187
- churn_date = f"{churn_month}-{churn_day:02}"
16188
- churn_ts = datetime.strptime(churn_date, "%Y-%m-%d").strftime("%d-%m-%Y") + "_23-59-59"
16189
- USER_STATUSES = [{random.choice(["left", "kicked"]): churn_ts}]
16190
-
16191
- user_dau = sorted(user_dau_dates)
16192
- wallet = f"wallet{random.randint(1, 100)}" if txs else random.choice([f"wallet{random.randint(1, 100)}", ""])
16193
-
16194
- data_users.append((
16195
- random.randint(100000, 999999),
16196
- json.dumps({"USER_WALLET": wallet, "USER_UTM": utm, "USER_DT": entry_dt}),
16197
- json.dumps({"USER_DAU": user_dau, "USER_MAU": user_mau, "USER_TXS": txs,
16198
- "USER_PAYMENTS": payments, "USER_STATUSES": USER_STATUSES})
16199
- ))
16200
- print(f"gen {data_users=}")
16201
-
16202
16138
  for USER_TID, USER_VARS, USER_LSTS in data_users:
16203
16139
  USER_VARS = json.loads(USER_VARS or "{}")
16204
16140
  USER_LSTS = json.loads(USER_LSTS or "{}")
@@ -16307,6 +16243,70 @@ async def return_cohort_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
16307
16243
  cohorts = defaultdict(set) # cohort_month -> set(USER_TID)
16308
16244
  activity_months = defaultdict(set) # USER_TID -> set месяцов, в которые был DAU
16309
16245
 
16246
+ months = ["2025-06", "2025-07", "2025-08", "2025-09"]
16247
+ data_users = []
16248
+ for _ in range(20):
16249
+ # дата входа
16250
+ entry_month = random.choice(months)
16251
+ entry_day = random.randint(1, 28)
16252
+ entry_date = f"{entry_month}-{entry_day:02}"
16253
+ entry_dt_obj = datetime.strptime(entry_date, '%Y-%m-%d')
16254
+ entry_dt = f"{entry_dt_obj.strftime('%d-%m-%Y')}_{datetime.now().strftime('%H-%M-%S')}"
16255
+ utm = random.choice(["/start", "/startapp"])
16256
+
16257
+ # месяцы от входа и дальше
16258
+ valid_months = [m for m in months if datetime.strptime(m + "-01", "%Y-%m-%d") >= entry_dt_obj.replace(day=1)]
16259
+ if not valid_months:
16260
+ valid_months = [entry_month]
16261
+
16262
+ user_mau = sorted(random.sample(valid_months, k=random.randint(1, len(valid_months))))
16263
+ user_dau_dates = set()
16264
+ txs, payments = [], []
16265
+
16266
+ # платеж
16267
+ if user_mau:
16268
+ pay_month = random.choice(user_mau)
16269
+ pay_day = random.randint(1, 28)
16270
+ pay_date = f"{pay_month}-{pay_day:02}"
16271
+ dt_pay = datetime.strptime(pay_date, "%Y-%m-%d")
16272
+ # if dt_pay >= entry_dt_obj:
16273
+ payments = [{
16274
+ "TYPE": random.choice(["don", "sub", "pst"]),
16275
+ "DT_START": f"{dt_pay.strftime('%d-%m-%Y')}_14-00-00",
16276
+ "DT_END": "0",
16277
+ "AMOUNT": str(random.randint(1, 10))
16278
+ }]
16279
+ user_dau_dates.add(pay_date)
16280
+
16281
+ # вход в приложение
16282
+ user_dau_dates.add(entry_date)
16283
+ for m in user_mau:
16284
+ day = random.randint(1, 28)
16285
+ visit = f"{m}-{day:02}"
16286
+ dt_visit = datetime.strptime(visit, "%Y-%m-%d")
16287
+ if dt_visit >= entry_dt_obj and random.random() < 0.7:
16288
+ user_dau_dates.add(visit)
16289
+
16290
+ # статусы (отток) с низкой вероятностью
16291
+ USER_STATUSES = []
16292
+ if random.random() < 0.2: # 10% шанс оттока
16293
+ churn_month = random.choice(valid_months)
16294
+ churn_day = random.randint(1, 28)
16295
+ churn_date = f"{churn_month}-{churn_day:02}"
16296
+ churn_ts = datetime.strptime(churn_date, "%Y-%m-%d").strftime("%d-%m-%Y") + "_23-59-59"
16297
+ USER_STATUSES = [{random.choice(["left", "kicked"]): churn_ts}]
16298
+
16299
+ user_dau = sorted(user_dau_dates)
16300
+ wallet = f"wallet{random.randint(1, 100)}" if txs else random.choice([f"wallet{random.randint(1, 100)}", ""])
16301
+
16302
+ data_users.append((
16303
+ random.randint(100000, 999999),
16304
+ json.dumps({"USER_WALLET": wallet, "USER_UTM": utm, "USER_DT": entry_dt}),
16305
+ json.dumps({"USER_DAU": user_dau, "USER_MAU": user_mau, "USER_TXS": txs,
16306
+ "USER_PAYMENTS": payments, "USER_STATUSES": USER_STATUSES})
16307
+ ))
16308
+ print(f"gen {data_users=}")
16309
+
16310
16310
  for USER_TID, USER_VARS, USER_LSTS in data_users:
16311
16311
  USER_VARS = json.loads(USER_VARS or "{}")
16312
16312
  USER_LSTS = json.loads(USER_LSTS or "{}")