Automated Drupal news aggregator with AI-powered summaries
Project description
Drupal News Aggregator
Automated Drupal news aggregation with AI summarization.
Installation
From PyPI
pip install drupal-news
# With AI providers
pip install drupal-news[openai]
pip install drupal-news[anthropic]
pip install drupal-news[all-providers]
From Source
./setup.sh
source venv/bin/activate
Quick Start
# Using installed package
drupal-news --dry-run
# Or from source
python3 index.py --dry-run
Configuration
Configuration Files Location
The CLI commands look for configuration files in this order:
-
Current working directory (default)
config.jsonproviders.yaml.env
-
Custom paths (via CLI flags)
drupal-news --config /path/to/config.json \ --providers /path/to/providers.yaml \ --env /path/to/.env
Environment Variables (.env)
TIMEZONE=Europe/Athens
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=user@example.com
SMTP_PASS=password
MAIL_TO=recipient@example.com
MAIL_FROM=sender@example.com
News Sources (config.json)
Edit config.json to manage RSS feeds and web pages.
AI Summarizer Prompt (prompt.md)
Edit prompt.md to customize the AI summarization prompt:
# Requirements
1. Focus on: AI module and news on AI
2. Each fact MUST include a [source](URL) link
3. Use clear, factual language - no hype
...
Note: If prompt.md is not found, the system uses a hardcoded default template.
AI Providers (providers.yaml)
Configure AI models in providers.yaml
Usage
Main Aggregator
# Using installed package
drupal-news --provider openai --days 7
drupal-news --dry-run --verbose
drupal-news --provider anthropic --email yes
# Or from source
python3 index.py --provider openai --days 7
Scheduler
# Using installed package
drupal-news-scheduler --every friday --hour 9 --provider openai
drupal-news-scheduler --every monday --hour 8 --email yes --days 7
# Or from source
python3 scheduler.py --every friday --hour 9 --provider openai
Email Sender
# Using installed package
drupal-news-email --latest
drupal-news-email --run-dir runs/2025-10-29
# Or from source
python3 -m drupal_news.email_sender --latest
Cron
# Using installed package
0 9 * * 5 drupal-news --provider openai --email yes
# Or from source
0 9 * * 5 cd /path && python3 index.py --provider openai
Web Viewer
# Using installed package
drupal-news-viewer
# Open http://localhost:5000
# Or from source
python3 viewer.py
Features: tabs/split view, run history, metrics, logs
Providers
Built-in: OpenAI, Anthropic, Gemini, Ollama, LMStudio, Qwen, Grok, DeepSeek, OpenRouter
Generic: Works with ANY OpenAI-compatible API (OpenRouter, Together AI, Groq, Perplexity, Fireworks, Azure OpenAI, custom endpoints)
CLI Commands
drupal-news
Main aggregator command. Fetches, parses, and summarizes Drupal news.
drupal-news [OPTIONS]
Options:
--provider <name> AI provider (openai, anthropic, gemini, etc.)
--model <name> Override provider's default model
--days <n> Timeframe in days (default: 7)
--email yes|no Send email report
--dry-run Skip AI and email (testing mode)
--fetch-only Only fetch and parse, skip AI
--use-sources <date> Use cached sources from date (YYYY-MM-DD)
--config <path> Custom config.json path
--providers <path> Custom providers.yaml path
--env <path> Custom .env path
--outdir <path> Custom output directory
--verbose Enable debug logging
drupal-news-scheduler
Schedule recurring aggregator runs.
drupal-news-scheduler --every <day> [OPTIONS]
Options:
--every <day> Day of week (monday-sunday)
--hour <n> Hour to run (0-23, default: 9)
--minute <n> Minute to run (0-59, default: 0)
--provider <name> AI provider to use
--model <name> Model override
--email yes|no Send email
--days <n> Number of days to aggregate
drupal-news-email
Send aggregated reports via email.
drupal-news-email [OPTIONS]
Options:
--latest Send latest report
--run-dir <path> Send specific run directory
--days <n> Days back to check (default: 7)
drupal-news-viewer
Launch web interface to view reports.
drupal-news-viewer
Opens http://localhost:5000
Features: tabs, run history, metrics, logs
Output
runs/YYYY-MM-DD/: parsed.md, summary.md, sources.json, metrics.json, run.log
Project Structure
When using from PyPI, configuration files are in ~/.drupal-news/ or current directory.
When using from source:
├── setup.sh # Setup script
├── index.py # Main entry (wrapper)
├── scheduler.py # Scheduler (wrapper)
├── viewer.py # Web viewer (wrapper)
├── src/ # Source code
├── venv/ # Virtual env
├── config.json # Configuration
├── providers.yaml # AI providers
├── prompt.md # Custom AI prompt (optional)
└── .env # Environment variables
Exit Codes
- 0: Success
- 10: Partial fetch failure
- 20: Validation failed
- 30: Summarizer failed
- 40: Email failure
- 50: Integrity check failed
Contributing
Contributions welcome! See docs/RELEASING.md for release process.
Creating a Release
# Patch release (bug fixes)
./release.sh patch -m "Bug fixes and improvements"
# Minor release (new features)
./release.sh minor -m "New features" --push
# Major release (breaking changes)
./release.sh major -m "Breaking changes" --push
The release script:
- Updates VERSION file
- Updates RELEASES.md with changelog
- Creates git commit and tag
- Optionally pushes to trigger automated PyPI publishing
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file drupal_news-0.0.1.tar.gz.
File metadata
- Download URL: drupal_news-0.0.1.tar.gz
- Upload date:
- Size: 67.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3eb8b4f1b1a468d6dd1e7c1d96a9ee144bf5571e19add1fb856544f5e4dcfb80
|
|
| MD5 |
3db04148ae4ef353c242540774042c7a
|
|
| BLAKE2b-256 |
30bc1ea3f2362a9aeea42f7c9f08e8331a08138ff1aac80352988f41c62d4252
|
File details
Details for the file drupal_news-0.0.1-py3-none-any.whl.
File metadata
- Download URL: drupal_news-0.0.1-py3-none-any.whl
- Upload date:
- Size: 63.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aae60a872a48f4e2a4eba908b339043bc1e5408583745c1e941e061580ef6c80
|
|
| MD5 |
beaca56615a1118c7a3a591a51c0411c
|
|
| BLAKE2b-256 |
e7678c4474be244599ac042010854c3784b85ea376425973f1803792262a943a
|