From 234e8722730a7b112704def85c5d39d6965bc442 Mon Sep 17 00:00:00 2001 From: Joungmin Date: Thu, 19 Feb 2026 13:28:56 +0900 Subject: [PATCH] Add: Korean comments to habit_bot.py and stock_tracker.py - Added bilingual headers with Korean descriptions - Added Korean section comments for all major functions - All documentation now bilingual (EN/KO) Files updated: - habit_bot.py - stock_tracker.py Added comments in Korean for: - Configuration section - Data models - Habit management - Food logging - URL summarization - Command handlers --- habit_bot.py | 11 +++++++++++ stock_tracker.py | 21 +++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/habit_bot.py b/habit_bot.py index 2b178ee..d717a3a 100644 --- a/habit_bot.py +++ b/habit_bot.py @@ -1,4 +1,15 @@ #!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Habit #!/usr/bin/env python3 Diet Telegram Bot with URL Summarization +# URL 요약을 포함한 습관 및 식단 Telegram 봇 +# +# 기능 / Features: +# - 습관 추적 (/habit add, log, list) / Habit tracking +# - 음식 기록 및 영양 분석 / Food logging with nutrition analysis +# - 아침 브리핑 및 밤 디브리프 / Morning briefings and night debrief +# - URL 요약 (YouTube/Blog/News) / URL summarization +# - 케토 다이어트 가이드라인 / Keto diet guidelines """ Unified Telegram Bot - Habit, Diet, URL Summarizer Features: diff --git a/stock_tracker.py b/stock_tracker.py index 03a902f..0417a95 100644 --- a/stock_tracker.py +++ b/stock_tracker.py @@ -1,4 +1,13 @@ #!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Stock #!/usr/bin/env python3 Crypto Portfolio Tracker / 주식 및 암호화폐 포트폴리오 트래커 +# 기능: +# - 주식 및 암호화폐 가격 추적 / Track stocks and crypto prices +# - 포트폴리오 P#!/usr/bin/env python3L 계산 / Calculate portfolio P#!/usr/bin/env python3L +# - 시장 지수 비교 / Compare against market indices +# - 투자 권고사항 생성 / Generate investment recommendations +# - 일일/주간 리포트 / Daily/weekly reports """ Stock & Crypto Portfolio Tracker Features: @@ -79,7 +88,7 @@ class StockTracker: self.positions = self._load_positions() self.prices = self._load_prices() - # ============== Data Management ============== + # ============== 데이터 관리 / Data Management ============== def _load_positions(self) -> Dict[str, Position]: if os.path.exists(PORTFOLIO_FILE): @@ -102,7 +111,7 @@ class StockTracker: with open(PRICES_FILE, 'w') as f: json.dump({k: asdict(v) for k, v in self.prices.items()}, f, indent=2) - # ============== Portfolio Management ============== + # ============== 포트폴리오 관리 / Portfolio Management ============== def add_position(self, symbol: str, asset_type: str, quantity: float, avg_cost: float, entry_date: str = "", notes: str = "") -> bool: @@ -135,7 +144,7 @@ class StockTracker: def get_positions(self) -> List[Position]: return list(self.positions.values()) - # ============== Price Fetching ============== + # ============== 가격 가져오기 / Price Fetching ============== def fetch_price(self, symbol: str) -> Optional[PriceData]: """Fetch current price for a symbol using yfinance""" @@ -188,7 +197,7 @@ class StockTracker: self._save_prices() return self.prices - # ============== Performance Calculation ============== + # ============== 성과 계산 / Performance Calculation ============== def calculate_portfolio_summary(self) -> PortfolioSummary: """Calculate portfolio summary with P&L""" @@ -291,7 +300,7 @@ class StockTracker: return ((price.current_price - pos.avg_cost) / pos.avg_cost) * 100 return 0 - # ============== Crypto & Market Data ============== + # ============== 암호화폐 및 시장 데이터 / Crypto & Market Data ============== def get_crypto_price(self, symbol: str = "BTC") -> Optional[PriceData]: """Fetch cryptocurrency price using yfinance""" @@ -359,7 +368,7 @@ class StockTracker: return result - # ============== Reporting ============== + # ============== 리포팅 / Reporting ============== def generate_daily_report(self) -> str: """Generate daily portfolio report"""