yeref 0.24.51__tar.gz → 0.24.53__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.51 → yeref-0.24.53}/PKG-INFO +1 -1
- {yeref-0.24.51 → yeref-0.24.53}/setup.py +1 -1
- {yeref-0.24.51 → yeref-0.24.53}/yeref/yeref.py +5 -20
- {yeref-0.24.51 → yeref-0.24.53}/yeref.egg-info/PKG-INFO +1 -1
- {yeref-0.24.51 → yeref-0.24.53}/pyproject.toml +0 -0
- {yeref-0.24.51 → yeref-0.24.53}/setup.cfg +0 -0
- {yeref-0.24.51 → yeref-0.24.53}/yeref/__init__.py +0 -0
- {yeref-0.24.51 → yeref-0.24.53}/yeref/l_.py +0 -0
- {yeref-0.24.51 → yeref-0.24.53}/yeref/tonweb.js +0 -0
- {yeref-0.24.51 → yeref-0.24.53}/yeref.egg-info/SOURCES.txt +0 -0
- {yeref-0.24.51 → yeref-0.24.53}/yeref.egg-info/dependency_links.txt +0 -0
- {yeref-0.24.51 → yeref-0.24.53}/yeref.egg-info/top_level.txt +0 -0
@@ -16140,7 +16140,7 @@ async def return_unit_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16140
16140
|
|
16141
16141
|
months = ["2025-06", "2025-07", "2025-08", "2025-09"]
|
16142
16142
|
data_users = []
|
16143
|
-
for _ in range(
|
16143
|
+
for _ in range(20):
|
16144
16144
|
# дата входа
|
16145
16145
|
entry_month = random.choice(months)
|
16146
16146
|
entry_day = random.randint(1, 28)
|
@@ -16158,21 +16158,6 @@ async def return_unit_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16158
16158
|
user_dau_dates = set()
|
16159
16159
|
txs, payments = [], []
|
16160
16160
|
|
16161
|
-
# транзакция
|
16162
|
-
if user_mau and random.random() < 0.5:
|
16163
|
-
tx_month = random.choice(user_mau)
|
16164
|
-
tx_day = random.randint(1, 28)
|
16165
|
-
tx_date = f"{tx_month}-{tx_day:02}"
|
16166
|
-
dt_tx = datetime.strptime(tx_date, "%Y-%m-%d")
|
16167
|
-
if dt_tx >= entry_dt_obj:
|
16168
|
-
txs = [{
|
16169
|
-
"TYPE": random.choice(["don", "sub", "pst"]),
|
16170
|
-
"AMOUNT": str(random.randint(1, 10)),
|
16171
|
-
"ADDRESS": f"address{random.randint(1, 999)}",
|
16172
|
-
"DT_START": f"{dt_tx.strftime('%d-%m-%Y')}_12-00-00",
|
16173
|
-
}]
|
16174
|
-
user_dau_dates.add(tx_date)
|
16175
|
-
|
16176
16161
|
# платеж
|
16177
16162
|
if user_mau:
|
16178
16163
|
pay_month = random.choice(user_mau)
|
@@ -16251,7 +16236,6 @@ async def return_unit_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16251
16236
|
N = data["N"]
|
16252
16237
|
MRR = data["sum_amount"]
|
16253
16238
|
|
16254
|
-
|
16255
16239
|
def fmt(x):
|
16256
16240
|
return (f"{x:.2f}".rstrip("0").rstrip(".")) if x is not None else ""
|
16257
16241
|
mrr_fmt = fmt(MRR)
|
@@ -16269,7 +16253,7 @@ async def return_unit_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16269
16253
|
else:
|
16270
16254
|
LTV2 = None
|
16271
16255
|
|
16272
|
-
LTV1 = LTV2
|
16256
|
+
# LTV1 = LTV2
|
16273
16257
|
# CMGR: от первого месяца до текущего
|
16274
16258
|
if idx == 0 or first_mrr is None or first_mrr == 0:
|
16275
16259
|
CMGR = None
|
@@ -16286,6 +16270,7 @@ async def return_unit_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16286
16270
|
"ARR": fmt(ARR),
|
16287
16271
|
"ChurnR": fmt(ChurnR),
|
16288
16272
|
"LTV1": fmt(LTV1),
|
16273
|
+
"LTV2": fmt(LTV2),
|
16289
16274
|
"CMGR": fmt(CMGR),
|
16290
16275
|
"CAC": ""
|
16291
16276
|
})
|
@@ -16293,11 +16278,11 @@ async def return_unit_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16293
16278
|
path = os.path.join(EXTRA_D, "2_unit_metrics.csv")
|
16294
16279
|
with open(path, "w", newline="", encoding="utf-8") as f:
|
16295
16280
|
writer = csv.writer(f)
|
16296
|
-
writer.writerow(["MO", "N", "MRR", "ARPU", "ARR", "ChurnR", "LTV1", "CMGR", "CAC"])
|
16281
|
+
writer.writerow(["MO", "N", "MRR", "ARPU", "ARR", "ChurnR", "LTV1", "LTV2", "CMGR", "CAC"])
|
16297
16282
|
for row in results:
|
16298
16283
|
writer.writerow([
|
16299
16284
|
row["MO"], row["N"], row["MRR"], row["ARPU"], row["ARR"],
|
16300
|
-
row["ChurnR"], row["LTV1"], row["CMGR"], row["CAC"]
|
16285
|
+
row["ChurnR"], row["LTV1"], row["LTV2"], row["CMGR"], row["CAC"]
|
16301
16286
|
])
|
16302
16287
|
|
16303
16288
|
# отправить файл
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|