-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_all.py
More file actions
28 lines (21 loc) · 829 Bytes
/
run_all.py
File metadata and controls
28 lines (21 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import asyncio
import logging
from src.run_scraper import run_scraper
from src.cleaning import run_cleaning_pipeline
from src.publisher import run_publisher
from src.utils import setup_logger
from src.utils import determine_mode
from src.utils import save_daily_clean_csv
if __name__ == "__main__":
setup_logger()
mode = determine_mode()
logging.info(f"[MODE] Выбран режим: {mode.upper()}")
logging.info("[STEP 1] Scraping raw data...")
raw = asyncio.run(run_scraper(mode=mode))
logging.info("[STEP 2] Cleaning data...")
cleaned = run_cleaning_pipeline(raw)
logging.info("[STEP 3] Saving to CSV...")
save_daily_clean_csv(cleaned)
logging.info("[STEP 4] Publishing to Telegram...")
asyncio.run(run_publisher())
logging.info("✅ Pipeline completed successfully!")