{"id":28295276,"url":"https://github.com/lunay77/astromailer","last_synced_at":"2026-04-30T16:33:16.009Z","repository":{"id":268478610,"uuid":"904452429","full_name":"LunaY77/AstroMailer","owner":"LunaY77","description":"AstroMailer 一个每日早安邮件发送器","archived":false,"fork":false,"pushed_at":"2024-12-18T09:31:07.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-30T16:33:14.831Z","etag":null,"topics":["astromailer","baidu-api","docker","docker-compose","mail","nasa","nasa-api","nasa-apod","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LunaY77.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-16T23:16:16.000Z","updated_at":"2024-12-18T09:31:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"1c7477b7-fc4f-4130-aae7-93cfc92eb8d1","html_url":"https://github.com/LunaY77/AstroMailer","commit_stats":null,"previous_names":["pale-illusions/astromailer","lunay77/astromailer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LunaY77/AstroMailer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LunaY77%2FAstroMailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LunaY77%2FAstroMailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LunaY77%2FAstroMailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LunaY77%2FAstroMailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LunaY77","download_url":"https://codeload.github.com/LunaY77/AstroMailer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LunaY77%2FAstroMailer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32470879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astromailer","baidu-api","docker","docker-compose","mail","nasa","nasa-api","nasa-apod","python","python3"],"created_at":"2025-05-22T12:18:20.406Z","updated_at":"2026-04-30T16:33:15.991Z","avatar_url":"https://github.com/LunaY77.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AstroMailer 🌌\n\n**AstroMailer** 是一个**每日早安邮件发送器**，它通过集成 **NASA 天文每日一图（APOD）、词霸金句和百度翻译 API**，为用户带来浪漫、温暖的早安邮件。\n\n## 功能概述\n\n* 📧 **每日发送早安邮件**\n    * 附带 **NASA** 天文每日一图及其解释。\n    * 包含词霸**每日金句**（中英双语）。\n    * 邮件支持**中英文翻译**，并使用简洁优雅的 **HTML** 样式设计。\n* 🌌 **随机背景色和样式**\n    * 邮件中的句子和背景配色采用动态随机生成，让每一天的邮件都有独特的风格。\n    * 🔄 **缓存**机制\n\t * 使用 **diskcache** 缓存 **NASA** 图片和内容，减少重复 API 请求。\n\n## 项目架构\n\n**AstroMailer** 的主要功能分为以下模块：\n\n1. **邮件发送模块**\n    * 使用 smtplib 实现邮件的发送。\n\t * 支持 HTML 格式化邮件内容。\n2. **API 调用模块**\n    * 集成 NASA APOD API 获取每日天文图片和描述。\n    * 集成百度翻译 API 翻译图片描述为中文。\n    * 使用词霸 API 获取每日金句。\n3. **定时任务模块**\n    * 使用 schedule 实现每天早上 8 点自动发送邮件。\n4. **缓存模块**\n    * 使用 diskcache 缓存数据，避免频繁调用 API。\n\n\n## 运行截图\n\n📧 邮件示例    \n\n![](https://cangjingyue.oss-cn-hangzhou.aliyuncs.com/2024/12/18/17345141645606.jpg)\n\n\n## 技术栈\n\n* 编程语言: Python 3.10+\n\n* 主要依赖:\n    * smtplib: 发送邮件\n    * schedule: 定时任务调度\n    * diskcache: 本地缓存\n    * requests: 调用 API\n    * PyYAML: 解析配置文件\n    \n* API:\n    * [NASA APOD API](https://api.nasa.gov/)\n    * [百度翻译 API](https://fanyi-api.baidu.com/)\n    * [词霸 API](https://open.iciba.com/dsapi/)\n\n## 安装与运行\n\n**1. 克隆项目**\n\n```bash\ngit clone https://github.com/Pale-illusions/AstroMailer.git\ncd AstroMailer\n```\n\n**2. 创建虚拟环境并安装依赖**\n\n```bash\n# 创建虚拟环境\npython3 -m venv myvenv\n\n# 激活虚拟环境\nsource myvenv/bin/activate  # macOS/Linux\nmyvenv\\Scripts\\activate     # Windows\n\n# 安装依赖\npip install -r requirements.txt\n```\n\n**3. 配置环境**\n\n在 `resources/config.yaml` 文件中配置你的 `API` 密钥和邮件账户信息。\n\n示例配置文件 `config.yaml`：\n\n```yaml\napi_key:\n  nasa: \"你的NASA_API_KEY\"\n  baidu_translate:\n    appid: \"你的百度翻译APPID\"\n    secret_key: \"你的百度翻译SECRET_KEY\"\n\nemail:\n  name: \"AstroMailer\"\n  smtp_server: \"smtp.gmail.com\"\n  smtp_port: 587\n  sender: \"your_email@example.com\"\n  password: \"your_email_password\"\n  recipients:\n    - \"recipient1@example.com\"\n    - \"recipient2@example.com\"\n```\n\n**4. 启动服务**\n\n直接运行\n\n```bash\npython src/main.py\n```\n\ndocker\n\n```bash\ndocker-compose up -d\n```\n\n\n## 贡献指南\n\n欢迎贡献代码！如果你想为 **AstroMailer** 提交新的功能或修复 bug，请按照以下步骤操作：\n\n1. Fork 仓库。\n2. 创建新分支：\n\n```bash\ngit checkout -b feature/your-feature-name\n```\n\n3. 提交代码并创建 Pull Request。\n\n## 开源协议\n\n本项目采用 [Apache-2.0 license](https://www.apache.org/licenses/LICENSE-2.0)。\n\n\n\n---\n\n感谢使用 AstroMailer，让宇宙的浪漫点亮你的每一天！✨\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunay77%2Fastromailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flunay77%2Fastromailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunay77%2Fastromailer/lists"}