feat: 축제·전시·콘서트·팝업 7일마다 수집, 피드 행사 종류 섞기

- 행사 수집을 화면 요청에서 빼고 worker 가 월 04:00(켤 때 7일 기록 없으면 한 번) 전국 17개 시도를 받는다
- 문화정보원 음악/콘서트(B000) 추가, 쪽·시도 사이 1초 간격으로 초당 요청 제한 회피
- 팝가(popga.co.kr) 팝업스토어 수집: 사이트맵 + 상세 JSON-LD, 바뀐 페이지만 다시 읽음
- 수집이 끝나면 Teams Workflows webhook 으로 종류별 건수 알림 (TEAMS_WEBHOOK_URL)
- event.kind(1=축제 2=전시 3=콘서트 4=팝업) 칸과 종류별 아이콘 추가
- 피드 행사 카드·띠를 축제→팝업→전시→콘서트 차례로 섞음
- 포스트 종류별 내용·피드 기획 문서 갱신

같은 작업 폴더의 다른 작업(외부 API 가드, 노을·달 계산, 각 API, 문서 파일 이름 정리 등)도 함께 담김.
This commit is contained in:
minaChoi committed 2026-10-07 12:03:48 +09:00
1 parent b61ed92c54
commit 997a366e76
70 files changed
+2083 -649

No files matched your search

+30 -3
View File
@@ -2,7 +2,7 @@ import statistics
from dataclasses import dataclass
from datetime import datetime, timedelta
from common.enums import Confidence, SkyGrade, SkyType
from common.enums import Confidence, SkyGrade, SkySituation, SkyType
DISTANCES_KM = (20, 50, 100)
@@ -49,10 +49,10 @@ def best_times(kind: SkyType, sun_at: datetime, twilight_at: datetime, high_clou
return [
{"at": sun_at.isoformat(), "kind": "sun", "label": "해 져요"},
{"at": (sun_at + timedelta(minutes=peak_min)).isoformat(), "kind": "peak", "label": "가장 붉을 때"},
{"at": twilight_at.isoformat(), "kind": "twilight", "label": "보랏빛 하늘"},
{"at": twilight_at.isoformat(), "kind": "twilight", "label": "블루아워"},
]
return [
{"at": twilight_at.isoformat(), "kind": "twilight", "label": "푸른 새벽"},
{"at": twilight_at.isoformat(), "kind": "twilight", "label": "블루아워"},
{"at": (sun_at - timedelta(minutes=peak_min)).isoformat(), "kind": "peak", "label": "가장 붉을 때"},
{"at": sun_at.isoformat(), "kind": "sun", "label": "해 떠요"},
]
@@ -73,6 +73,33 @@ def mean_layers(rows: list[Layers]) -> Layers:
return Layers(*(statistics.mean(getattr(r, k) for r in rows) for k in ("low", "mid", "high")))
def situation(near20: Layers, near50: Layers, far100: Layers) -> SkySituation:
"""하늘 상황 하나. reason() 과 같은 순서로 본다: 먼 쪽이 막혔나 → 머리 위 낮은 구름 → 물들 중·높은 구름의 양."""
if far100.low + 0.5 * far100.mid >= 60:
return SkySituation.COVERED
if (near20.low + near50.low) / 2 >= 60:
return SkySituation.LOW_CLOUD
canvas = (max(near20.mid, near20.high) + max(near50.mid, near50.high)) / 2
if canvas < 25:
return SkySituation.FEW
if canvas > 75:
return SkySituation.THICK
return SkySituation.GLOW
SITUATION_LINE = {
SkySituation.COVERED: "구름에 가려요",
SkySituation.LOW_CLOUD: "낮은 구름이 덮어요",
SkySituation.FEW: "구름이 적어 짧게 끝나요",
SkySituation.GLOW: "하늘이 넓게 물들 수 있어요",
SkySituation.THICK: "구름이 두꺼워 색이 약해요",
}
SITUATION_VERDICT = {
SkySituation.COVERED: "rest", SkySituation.LOW_CLOUD: "rest", SkySituation.FEW: "maybe", SkySituation.GLOW: "go", SkySituation.THICK: "maybe",
}
VERDICT_RANK = {"rest": 0, "maybe": 1, "go": 2}
def reason(near20: Layers, near50: Layers, far100: Layers) -> str:
"""score() 가 깎는 순서대로 본다: 먼 쪽 빛이 막혔나 → 머리 위 낮은 구름 → 물들 중·높은 구름의 양."""
if far100.low + 0.5 * far100.mid >= 60: