Travel Itinerary Builder
Generate comprehensive, print-ready travel itineraries with automatic integration of weather, places, dining, transportation, and budget planning.
⚠️ Security & Privacy Notice
This skill accesses sensitive data and requires external credentials:
Gmail Access (Optional)
- - The
gmail_parser.py script reads your Gmail messages to extract booking confirmations - Requires
GOG_KEYRING_PASSWORD environment variable (for GOG CLI authentication) - What it accesses: Email subjects, snippets, and full message bodies matching search queries
- What it extracts: Flight details (PNR, times), hotel bookings, car rentals, activity tickets
- Data handling: Extracted data is stored locally in JSON files; no external transmission
Google Places API (Optional)
- - The
places_fetcher.py script queries Google Places for attractions - Requires
GOOGLE_PLACES_API_KEY environment variable (free tier: 1000 requests/month) - Fallback to built-in database if API key not provided
External CLI Dependencies
- - gog (Google OAuth CLI): Authenticates Gmail access via OAuth2
- goplaces: Queries Google Places API
- curl: Fetches weather data from wttr.in
Before installing:
- 1. Review all scripts in
scripts/ directory - Only provide credentials if you trust the external CLIs
- Consider running in an isolated environment (container/VM)
- Gmail integration is optional — you can use the skill without it
Quick Start
Basic Usage
CODEBLOCK0
With Gmail Integration
CODEBLOCK1
Core Features
1. Automatic Data Collection
- - Weather forecasts: Integrates with
weather skill for daily forecasts - Points of interest: Uses
goplaces skill for attractions, restaurants, landmarks - Multi-language names: Shows place names in user language + local language
- Gmail parsing: Extracts flight, hotel, car rental bookings from confirmation emails
2. Intelligent Planning
- - Daily schedules: Auto-generates time-based itineraries (08:00 departure → 10:00 attraction → 12:00 lunch)
- Transportation routing: Calculates distances, travel times, and costs for driving/transit
- Budget estimation: Computes total costs for accommodation, meals, transport, tickets
- Packing lists: Generates climate-appropriate packing suggestions
3. Output Formats
- - HTML: Beautiful dark-themed, print-ready documents (based on proven template)
- Markdown: Editable plain-text format
- JSON: Structured data for further processing
- PDF: Optional export via HTML → PDF conversion
Workflow
Step 1: Gather Information
Ask user for:
- - Destinations (cities/regions)
- Travel dates (start and end)
- Budget range (optional)
- Interests/tags (history, nature, food, shopping, concerts)
- Language preference (zh, en, ja, ko)
- Special requirements (dietary, accessibility, child-friendly)
Step 2: Extract Existing Bookings (Optional)
If user has Gmail access configured:
CODEBLOCK2
This extracts:
- - ✈️ Flights: airline, flight number, departure/arrival times, PNR
- 🏨 Hotels: name, address, check-in/out dates, booking number, price
- 🚗 Car rentals: company, car type, pickup/return times, booking number
- 🎫 Tickets: concerts, museums, activities with times and seat info
Supported platforms: Agoda, Booking.com, Singapore Airlines, ANA, Trip.com, Klook, KKday
Step 3: Query Weather and Places
CODEBLOCK3
Step 4: Generate Itinerary
CODEBLOCK4
Step 5: Export (Optional)
CODEBLOCK5
Scripts Reference
generate_itinerary.py
Core generator. Combines all data sources into a complete itinerary.
Arguments:
- -
--destination: Comma-separated list of cities/regions - INLINECODE9 : Trip start date (YYYY-MM-DD)
- INLINECODE10 : Trip end date (YYYY-MM-DD)
- INLINECODE11 : Path to bookings JSON (from gmailparser.py)
- INLINECODE12 : Path to weather JSON (from weatherfetcher.py)
- INLINECODE13 : Path to places JSON (from places_fetcher.py)
- INLINECODE14 : Total budget amount (optional)
- INLINECODE15 : Currency code (SGD, USD, JPY, etc.)
- INLINECODE16 : Output language (zh, en, ja, ko)
- INLINECODE17 : Comma-separated tags (history, nature, food, shopping, concerts)
- INLINECODE18 : Output file path (.html, .md, or .json)
gmail_parser.py
Extracts travel bookings from Gmail using GOG skill.
Requirements: GOGKEYRINGPASSWORD environment variable
Arguments:
- -
--account: Gmail account email - INLINECODE21 : Start date for email search (YYYY-MM-DD)
- INLINECODE22 : Search keywords (default: "flight,hotel,booking,confirmation")
- INLINECODE23 : Output JSON file
weather_fetcher.py
Fetches weather forecasts for destinations using weather skill.
Arguments:
- -
--destinations: Comma-separated cities - INLINECODE26 : Forecast start date
- INLINECODE27 : Forecast end date
- INLINECODE28 : Output JSON file
places_fetcher.py
Queries points of interest using goplaces skill.
Arguments:
- -
--destinations: Comma-separated cities - INLINECODE31 : Activity tags (temples, museums, food, shopping)
- INLINECODE32 : Display language
- INLINECODE33 : Output JSON file
translator.py
Translates place names to multiple languages.
Arguments:
- -
--text: Text to translate - INLINECODE36 : Source language code
- INLINECODE37 : Comma-separated target language codes
- INLINECODE38 : Output JSON file
budget_calculator.py
Estimates trip costs based on destination, duration, and bookings.
Arguments:
- -
--destination: Primary destination - INLINECODE41 : Number of days
- INLINECODE42 : Path to bookings JSON
- INLINECODE43 : Budget category (budget, mid-range, luxury)
- INLINECODE44 : Output JSON file
export_html.py
Converts itinerary JSON to styled HTML using template.
Arguments:
- -
--input: Itinerary JSON file - INLINECODE47 : HTML template (default: assets/itinerary_template.html)
- INLINECODE48 : Output HTML file
References
- - destinationtemplates.md: Pre-built templates for popular destinations (Tokyo, Seoul, Paris, etc.)
- traveltips.md: Climate guides, packing lists, visa requirements, cultural tips
- emailpatterns.md: Email parsing rules for different booking platforms
- poidatabase.md: Common attractions with multi-language names
Assets
- - itinerary_template.html: Dark-themed HTML template with CSS styling
- icons/: SVG icons for flights, hotels, restaurants, attractions
- fonts/: Web fonts for print-quality output
Multi-Language Support
Place names are displayed in user language + local language:
CODEBLOCK6
Supported languages: Chinese (zh), English (en), Japanese (ja), Korean (ko)
Output Example
Generated HTML includes:
- - 📅 Day-by-day timeline with emoji icons
- 🌤️ Daily weather forecasts
- ✈️ Flight details with boarding times
- 🏨 Hotel information with check-in/out
- 🚗 Driving routes with distances and tolls
- 🍽️ Restaurant recommendations with local specialties
- 💰 Budget breakdown by category
- 📋 Packing checklist based on climate
- ⚠️ Important reminders (visa, insurance, IDP)
Integration with Other Skills
This skill calls:
- -
weather — Daily forecasts - INLINECODE50 — Attraction and restaurant search
- INLINECODE51 — Gmail parsing (optional, requires GOGKEYRINGPASSWORD)
- INLINECODE52 — Sync to Notion database (optional, requires Notion API key)
Tips
- - For self-driving trips: Include rental car details, calculate fuel costs, note toll roads
- For concert/event trips: Add venue info, seating, merchandise shop times
- For multi-city trips: Calculate transit times between cities
- For international trips: Include visa requirements, vaccination, travel insurance reminders
Troubleshooting
- - Gmail parsing fails: Check GOGKEYRINGPASSWORD is set and account has access
- Weather data missing: Ensure dates are within forecast range (usually 10 days)
- Places not found: Try broader search terms or check goplaces API key
- HTML rendering issues: Open in modern browser (Chrome, Firefox, Safari)
Future Enhancements
- - Real-time flight status updates
- Amadeus API integration for flight price tracking
- Google Sheets export for budget tracking
- PDF generation without external tools
- Mobile-responsive HTML output
旅行行程生成器
生成全面、可打印的旅行行程,自动整合天气、地点、餐饮、交通和预算规划。
⚠️ 安全与隐私声明
此技能可访问敏感数据,需要外部凭证:
Gmail 访问(可选)
- - gmailparser.py 脚本读取您的 Gmail 邮件以提取预订确认信息
- 需要 GOGKEYRING_PASSWORD 环境变量(用于 GOG CLI 身份验证)
- 访问内容:匹配搜索条件的邮件主题、摘要和完整正文
- 提取内容:航班详情(PNR、时间)、酒店预订、租车信息、活动门票
- 数据处理:提取的数据本地存储为 JSON 文件;不进行外部传输
Google Places API(可选)
- - placesfetcher.py 脚本查询 Google Places 获取景点信息
- 需要 GOOGLEPLACESAPIKEY 环境变量(免费层级:每月 1000 次请求)
- 如未提供 API 密钥,则回退到内置数据库
外部 CLI 依赖
- - gog(Google OAuth CLI):通过 OAuth2 验证 Gmail 访问
- goplaces:查询 Google Places API
- curl:从 wttr.in 获取天气数据
安装前:
- 1. 审查 scripts/ 目录中的所有脚本
- 仅在信任外部 CLI 的情况下提供凭证
- 考虑在隔离环境(容器/虚拟机)中运行
- Gmail 集成为可选——您可以在不使用的情况下使用此技能
快速开始
基本用法
bash
从用户输入生成行程
python3 scripts/generate_itinerary.py \
--destination 东京, 大阪, 京都 \
--start-date 2026-03-06 \
--end-date 2026-03-15 \
--language zh \
--output ./japan_trip.html
使用 Gmail 集成
bash
从 Gmail 提取预订信息并生成行程
python3 scripts/gmail_parser.py \
--account rachelchoo1212@gmail.com \
--after 2026-03-01 \
--output ./bookings.json
python3 scripts/generate_itinerary.py \
--bookings ./bookings.json \
--destination 东京, 大阪 \
--start-date 2026-03-06 \
--end-date 2026-03-15 \
--output ./trip.html
核心功能
1. 自动数据收集
- - 天气预报:与 weather 技能集成,获取每日预报
- 兴趣点:使用 goplaces 技能获取景点、餐厅、地标信息
- 多语言名称:以用户语言 + 当地语言显示地点名称
- Gmail 解析:从确认邮件中提取航班、酒店、租车预订信息
2. 智能规划
- - 每日行程:自动生成基于时间的行程安排(08:00 出发 → 10:00 景点 → 12:00 午餐)
- 交通路线:计算驾车/公共交通的距离、行程时间和费用
- 预算估算:计算住宿、餐饮、交通、门票的总费用
- 行李清单:生成适合气候的打包建议
3. 输出格式
- - HTML:精美的深色主题、可打印文档(基于经过验证的模板)
- Markdown:可编辑的纯文本格式
- JSON:结构化数据,便于进一步处理
- PDF:通过 HTML 转 PDF 的可选导出
工作流程
步骤 1:收集信息
向用户询问:
- - 目的地(城市/地区)
- 旅行日期(开始和结束)
- 预算范围(可选)
- 兴趣/标签(历史、自然、美食、购物、演唱会)
- 语言偏好(zh, en, ja, ko)
- 特殊要求(饮食、无障碍设施、亲子友好)
步骤 2:提取现有预订(可选)
如果用户配置了 Gmail 访问:
bash
python3 scripts/gmail_parser.py \
--account <邮箱> \
--after \
--keywords flight,hotel,booking,reservation,confirmation \
--output bookings.json
提取内容:
- - ✈️ 航班:航空公司、航班号、出发/到达时间、PNR
- 🏨 酒店:名称、地址、入住/退房日期、预订号、价格
- 🚗 租车:公司、车型、取车/还车时间、预订号
- 🎫 门票:演唱会、博物馆、活动的时间及座位信息
支持的平台:Agoda、Booking.com、新加坡航空、全日空、Trip.com、Klook、KKday
步骤 3:查询天气和地点
bash
每个目的地的天气预报
python3 scripts/weather_fetcher.py \
--destinations 东京,大阪,京都 \
--start-date 2026-03-06 \
--end-date 2026-03-15 \
--output weather.json
兴趣点
python3 scripts/places_fetcher.py \
--destinations 东京,大阪,京都 \
--interests 寺庙,美食,购物 \
--language zh \
--output places.json
步骤 4:生成行程
bash
python3 scripts/generate_itinerary.py \
--bookings bookings.json \
--weather weather.json \
--places places.json \
--start-date 2026-03-06 \
--end-date 2026-03-15 \
--budget 2000 \
--currency SGD \
--language zh \
--output japan_trip.html
步骤 5:导出(可选)
bash
导出为 PDF
python3 scripts/export
pdf.py japantrip.html japan_trip.pdf
同步到 Notion(如果已配置)
python3 scripts/sync
notion.py japantrip.json
脚本参考
generate_itinerary.py
核心生成器。将所有数据源合并为完整的行程。
参数:
- - --destination:以逗号分隔的城市/地区列表
- --start-date:行程开始日期(YYYY-MM-DD)
- --end-date:行程结束日期(YYYY-MM-DD)
- --bookings:预订 JSON 文件路径(来自 gmailparser.py)
- --weather:天气 JSON 文件路径(来自 weatherfetcher.py)
- --places:地点 JSON 文件路径(来自 places_fetcher.py)
- --budget:总预算金额(可选)
- --currency:货币代码(SGD、USD、JPY 等)
- --language:输出语言(zh、en、ja、ko)
- --interests:以逗号分隔的标签(历史、自然、美食、购物、演唱会)
- --output:输出文件路径(.html、.md 或 .json)
gmail_parser.py
使用 GOG 技能从 Gmail 提取旅行预订信息。
要求:GOGKEYRINGPASSWORD 环境变量
参数:
- - --account:Gmail 账户邮箱
- --after:邮件搜索开始日期(YYYY-MM-DD)
- --keywords:搜索关键词(默认:flight,hotel,booking,confirmation)
- --output:输出 JSON 文件
weather_fetcher.py
使用 weather 技能获取目的地的天气预报。
参数:
- - --destinations:以逗号分隔的城市列表
- --start-date:预报开始日期
- --end-date:预报结束日期
- --output:输出 JSON 文件
places_fetcher.py
使用 goplaces 技能查询兴趣点。
参数:
- - --destinations:以逗号分隔的城市列表
- --interests:活动标签(寺庙、博物馆、美食、购物)
- --language:显示语言
- --output:输出 JSON 文件
translator.py
将地点名称翻译为多种语言。
参数:
- - --text:要翻译的文本
- --source-lang:源语言代码
- --target-langs:以逗号分隔的目标语言代码
- --output:输出 JSON 文件
budget_calculator.py
根据目的地、行程天数和预订信息估算旅行费用。
参数:
- - --destination:主要目的地
- --days:天数
- --bookings:预订 JSON 文件路径
- --category:预算类别(经济、中等、豪华)
- --output:输出 JSON 文件
export_html.py