AI-Powered Automated Newspaper Generation Tool ๐ค๐ฐ
AutoPaper is a CLI tool that automatically generates curated weekly newspapers from article URLs. ไธญๆ็จๆทๅฏๅ้ ๅข้ไฝฟ็จๆๅ ๅฟซ้ไธๆใ It uses Claude AI to extract metadata, compose editorial content, and export to multiple formats.
- ๐ค AI-Powered Curation - Smart metadata extraction and issue composition using Claude
- ๐ฐ Auto-Generated Newspapers - Weekly tech/news issues with editor's insights
- ๐ท๏ธ Smart Tagging - Automatic tag classification and normalization
- ๐ Multiple Export Formats - Markdown, PDF, Obsidian vault sync, and Email delivery
- ๐ง Email Distribution - Send issues via email with AI card, PDF attachments, and HTML rendering
- ๐จ AI Card Generation - Beautiful AI-style infographic cards for social sharing
- ๐ Article Links Section - Quick access to all original article URLs at the bottom
- โก High Performance - 100x faster with AI caching and concurrent downloads
- ๐ก๏ธ Production Ready - Robust error handling, retry logic, and comprehensive logging
- Python 3.10+
- Anthropic API key
# Clone the repository
git clone https://github.com/OldCoderIsMe/AutoPaper.git
cd AutoPaper
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in editable mode
pip install -e .
# Configure environment
cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEYAfter installation, you have two options:
Add this to your ~/.zshrc (or ~/.bashrc):
# AutoPaper venv
export PATH="$PATH:/path/to/AutoPaper/venv/bin"Then reload: source ~/.zshrc
cd /path/to/AutoPaper
source venv/bin/activate
autopaper --help# 1. Add articles throughout the week
autopaper add https://blog.example.com/ai-tool-review
autopaper add https://news.example.com/tech-trend-2026
# 2. View all articles
autopaper list-articles
# 3. Generate weekly issue
autopaper generate tech
# 4. Export to PDF (includes AI card)
autopaper export-pdf 2026-W05-tech
# 5. Send to team via email
autopaper send-email 2026-W05-tech \
--to team@company.com \
--to manager@company.com \
--to subscribers@company.com
# 6. Optionally sync to Obsidian
autopaper sync obsidian 2026-W05-techEach generated issue includes:
- ๐ PDF Document - Professional layout with AI card and article links
- ๐ง Email HTML - Rich formatted email with embedded AI card and clickable links
- ๐ Markdown Source - Plain text for version control with article links
- ๐จ AI Card - Shareable infographic (2400x1350px)
- ๐ Article Links - All original article URLs at the bottom for quick access
- ๐ Obsidian Notes - Integrated into your knowledge base
# Send to single recipient
autopaper send-email 2026-W05-tech --to user@example.com
# Send to multiple recipients
autopaper send-email 2026-W05-tech \
--to user1@example.com \
--to user2@example.com \
--to user3@example.com
# Custom email subject
autopaper send-email 2026-W05-tech \
--to user@example.com \
--subject "ๆฌๅจๆๆฏ็ฒพ้็ฌฌ5ๆ"
# Send without PDF attachment
autopaper send-email 2026-W05-tech \
--to user@example.com \
--no-pdf| Command | Description |
|---|---|
autopaper add <url> |
Add article from URL |
autopaper list-articles |
List all articles |
autopaper generate <type> |
Generate weekly issue (tech/news) |
autopaper export-pdf <slug> |
Export issue to PDF |
autopaper send-email <slug> |
Send issue via email |
autopaper generate-card <slug> |
Generate AI summary card |
autopaper sync obsidian <slug> |
Sync to Obsidian vault |
See autopaper --help for all commands and options.
- Quick Start Guide - Detailed setup and usage
- Team Guide (ๅข้ไฝฟ็จๆๅ) - ไธญๆๅฟซ้ๅฎ่ฃ ไธไฝฟ็จ
- Email Feature Guide - Email sending configuration and usage
- Design Document - Architecture and technical details
- Contributing - Contribution guidelines
AutoPaper/
โโโ autopaper/ # Main package
โ โโโ ai/ # AI integration modules
โ โ โโโ compose_issue.py # Issue composition
โ โ โโโ extract_article_metadata.py # Metadata extraction
โ โ โโโ generate_infocard.py # AI card generation
โ โ โโโ normalize_tags.py # Tag normalization
โ โโโ commands/ # CLI commands
โ โ โโโ add.py # Add articles
โ โ โโโ generate.py # Generate issues
โ โ โโโ export.py # PDF export
โ โ โโโ email.py # Email sending
โ โ โโโ sync.py # Obsidian sync
โ โโโ publishers/ # Export publishers
โ โ โโโ pdf.py # PDF generation
โ โ โโโ obsidian.py # Obsidian sync
โ โ โโโ email.py # Email publisher
โ โโโ scrapers/ # Web scraping
โ โโโ templates/ # Jinja2 templates
โ โ โโโ issue.html.j2 # PDF template
โ โ โโโ email.html.j2 # Email template
โ โโโ utils/ # Utilities
โโโ tests/ # Test suite
โโโ docs/ # Documentation
โ โโโ QUICKSTART.md
โ โโโ EMAIL_FEATURE.md
โ โโโ AutoPaper-Design.md
โโโ claude-skills/ # Standalone Claude Code Skills
โ โโโ shared/ # Shared config, cache, retry, JSON parser
โ โโโ generate-card/ # AI info card generator
โ โ โโโ SKILL.md
โ โ โโโ main.py # Launcher
โ โ โโโ scripts/
โ โ โโโ references/
โ โ โโโ assets/
โ โโโ extract-metadata/ # Article metadata extractor
โ โโโ SKILL.md
โ โโโ main.py
โ โโโ scripts/
โ โโโ references/
โ โโโ assets/
โโโ TEAM_GUIDE.md # ๅข้ไฝฟ็จๆๅ๏ผไธญๆ๏ผ
โโโ issues/ # Generated issues
AutoPaper's core AI capabilities are also available as standalone Claude Code Skills that can be used independently. Each skill follows the official layout: SKILL.md, scripts/, references/, assets/.
-
๐ Article Metadata Extractor (
extract-metadata/)- Extract structured metadata from article URLs or content
- Auto-generate summaries, tags, and key points
- Classify articles (technical vs news)
-
๐จ AI Info Card Generator (
generate-card/)- Generate beautiful SVG infographic cards (1200x675)
- Modern AI tech style with Chinese font support
- Perfect for blog covers, social media, presentations
Run from the skill root (no PYTHONPATH needed):
cd claude-skills
# Extract article metadata
python extract-metadata/main.py https://blog.example.com/article
# Generate info card
python generate-card/main.py "ๆฌๅจๆๆฏ็ฒพ้" --content article.mdEach skill's main.py is a launcher that runs scripts/main.py. See generate-card/SKILL.md and extract-metadata/SKILL.md for full usage and options.
AutoPaper supports two modes with identical configuration features:
- CLI Mode: Use
autopapercommand directly - Skill Mode: Use via Claude Code (
/autopaper-*commands)
Both modes support full configuration through config.yaml and .env files.
CLI Mode: Loads configuration from the current working directory.
Skill Mode: Automatically discovers project configuration by:
- Searching upward for
config.yamlfrom the current directory - Using
AUTOPAPER_CONFIG_PATHenvironment variable (if set) - Falling back to sensible defaults
This means skills work from any directory while respecting your project configuration.
Create a .env file in the project root:
# ============================================
# API Configuration
# ============================================
# API Key - supports both ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN
ANTHROPIC_API_KEY=your_api_key_here
# API Base URL (optional - for custom endpoints or proxy)
# Default: https://api.anthropic.com
# Example for ๆบ่ฐฑAI (GLM-4):
ANTHROPIC_BASE_URL=https://open.bigmodel.cn/api/anthropic
# Model Configuration (optional)
# ANTHROPIC_MODEL - default model for all requests
# ANTHROPIC_DEFAULT_SONNET_MODEL - for Sonnet-specific requests
# ANTHROPIC_DEFAULT_OPUS_MODEL - for Opus-specific requests
# ANTHROPIC_DEFAULT_HAIKU_MODEL - for Haiku-specific requests
#
# Example for GLM-4 (ๆบ่ฐฑAI):
ANTHROPIC_MODEL=glm-4.7
ANTHROPIC_DEFAULT_SONNET_MODEL=glm-4.7
#
# Example for Claude (Anthropic):
# ANTHROPIC_MODEL=claude-sonnet-4-5-20250929
# ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-5-20250929
# ============================================
# Email Configuration (SMTP)
# ============================================
# SMTP Server Configuration
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
EMAIL_USERNAME=your_email@gmail.com
EMAIL_PASSWORD=your_app_password
EMAIL_FROM=AutoPaper <your_email@gmail.com>
# Common SMTP Servers:
# - Gmail: smtp.gmail.com:587
# - Outlook: smtp-mail.outlook.com:587
# - QQ Mail: smtp.qq.com:587
# - 163 Mail: smtp.163.com:465
# Note: For Gmail, use App Password instead of regular password
# Get it from: Google Account > Security > 2-Step Verification > App passwordsEdit config.yaml to customize:
# Database
database_path: data/db.sqlite
# Obsidian sync
obsidian:
vault_path: ~/Documents/ObsidianVault
auto_paper_folder: AutoPaper
# Tag normalization
tag_normalization:
llm: [llm, large language model, gpt]
kubernetes: [k8s]AutoPaper uses Claude AI for:
- Metadata Extraction - Title, author, summary, key points
- Tag Classification - Automatic categorization
- Issue Composition - Editor's notes, trend analysis
- Content Understanding - Intelligent article curation
- AI Card Generation - Beautiful infographic cards with key highlights
AutoPaper automatically generates AI-style infographic cards for each issue:
- 1200x675 landscape format (16:9)
- Modern dark theme with gradient accents
- Smart summary of 4 key points
- Professional design for sharing on social media
- Embedded in both PDF and email
# Generate standalone card
autopaper generate-card 2026-W05-tech
# Card is automatically included in:
# - PDF export
# - Email HTML body (as base64 image)- 100x faster - AI caching for duplicate articles
- 10x faster - Concurrent image downloads
- Automatic retry - Network resilience
- Smart logging - Performance monitoring
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Code formatting
black autopaper/
isort autopaper/# Run all tests
pytest tests/
# With coverage
pytest --cov=autopaper tests/MIT License - see LICENSE file for details.
Built with:
- Claude - AI capabilities
- Typer - CLI framework
- Rich - Terminal formatting
- WeasyPrint - PDF generation
- Jinja2 - Template engine
- aiosmtplib - Async SMTP client
AutoPaper supports sending generated issues via email with:
- Rich HTML emails - Rendered markdown with AI card embedded
- PDF attachments - High-quality PDF with AI card
- Markdown attachments - Source files for archiving
- Article links section - Quick access to all original article URLs
- Multiple recipients - Send to unlimited recipients at once
- Major providers - Gmail, Outlook, QQ Mail, 163 Mail, and more
# 1. Configure SMTP in .env
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
EMAIL_USERNAME=your@gmail.com
EMAIL_PASSWORD=your_app_password
EMAIL_FROM=AutoPaper <your@gmail.com>
# 2. Send email
autopaper send-email 2026-W05-tech --to recipient@example.com๐ See docs/EMAIL_FEATURE.md for detailed email setup guide.
Ready to automate your newsletter workflow? ๐
- Documentation: docs/
- Email Guide: docs/EMAIL_FEATURE.md
- Contributing: CONTRIBUTING.md
- Issues: GitHub Issues