gendesign/tradein-mvp/backend/tests
lekss361 23f89d1935 feat(tradein): yandex_helpers.py — shared parsing utilities + tests
Foundation helpers for YandexRealtyScraper v1 Stages 3-6:
- JSON-LD extraction (extract_json_ld, find_ld_by_type) — Product/Offer/BreadcrumbList
- Regex constants (RE_OFFER_ID, RE_JK_ID, RE_TITLE_AREA, RE_TITLE_ROOMS, RE_FLOOR,
  RE_PRICE, RE_PPM2, RE_VIEWS, RE_METRO_WALK, RE_YEAR, RE_AGENCY_*)
- Russian date parsers (parse_ru_date "9 мая 2026" + parse_dmy "17.02.2026")
- NLP helpers (parse_house_type → panel/monolith/brick/block/wood;
  parse_house_class → elite/premium/business/comfort_plus/comfort/economy)
- Money parser (parse_rub: "4 399 000 ₽" / "4,4 млн ₽" / "117500" / None)

Spec fixes: RE_TITLE_ROOMS split into two alternations to handle standalone
"Студия" (group 2) vs "N-комнатная" (group 1); parse_house_class premium
pattern extended to cover reversed word order "премиум-класса".

Test coverage: 36 unit tests across all helpers (uv run pytest passes,
ruff check clean).
2026-05-23 16:07:02 +03:00
..
__init__.py feat(tradein): avito_imv.py — Avito IMV evaluation API client (2 requests) (#444) 2026-05-23 12:16:47 +00:00
test_avito_detail_parse.py feat(tradein): avito_detail.py — detail page parser (30+ fields incl. domoteka) (#443) 2026-05-23 12:17:15 +00:00
test_avito_houses_parse.py feat(tradein): avito_houses.py — Houses Catalog parser (state + reviews + history + recs) (#449) 2026-05-23 12:37:24 +00:00
test_avito_imv_parse.py feat(tradein): avito_imv.py — Avito IMV evaluation API client (2 requests) (#444) 2026-05-23 12:16:47 +00:00
test_base_save_listings.py feat(tradein): extend base.py save_listings to persist Cian-specific columns (PR #450 follow-up) (#455) 2026-05-23 13:05:20 +00:00
test_cian_serp_scraper.py feat(tradein): cian.py SERP refactor — state-based extraction (137 fields, no jitter) (#450) 2026-05-23 12:52:04 +00:00
test_cian_state_parser.py feat(tradein): cian_state_parser shared utility + ScrapedLot Cian fields (#447) 2026-05-23 12:35:01 +00:00
test_scrape_pipeline.py feat(tradein): scrape_pipeline.py — Avito full orchestrator (search → houses → detail) (#451) 2026-05-23 12:55:13 +00:00
test_yandex_helpers.py feat(tradein): yandex_helpers.py — shared parsing utilities + tests 2026-05-23 16:07:02 +03:00