π Popo CLI
PopocatΓ©petl Volcano Monitoring CLI & Library
A fast, reliable command-line tool and Rust library for fetching real-time volcanic activity data from Mexico's CENAPRED monitoring system for PopocatΓ©petl volcano.
β¨ Features
- π Fast & Efficient - Written in Rust, blazingly fast scraping with minimal resource usage
- π Rich Data - Comprehensive volcanic activity metrics from official CENAPRED reports
- π Historical Data - Access reports from any date (format: YYYY-MM-DD)
- π¨ Multiple Output Formats - Human-readable terminal output or JSON for programmatic use
- π Easy Integration - Use as a CLI tool or Rust library in your own projects
- π Cross-Platform - Works on Linux, macOS, and Windows
- π¦ Zero-Cost Distribution - No servers to maintain, runs entirely on your machine
π₯ Installation
From Source
Using Cargo (coming soon)
π Quick Start
CLI Usage
Fetch the latest volcano report (human-readable):
Get data in JSON format:
Show detailed alert information:
Fetch a specific historical date:
# Human-readable format
# JSON format
As a Library
Add to your Cargo.toml:
[]
= "0.1.0"
Use in your Rust code:
use ;
use NaiveDate;
From Other Languages
Since popo outputs clean JSON, you can easily use it from any language:
Python:
=
=
Node.js:
const = require;
const data = JSON.;
console.log;
Go:
cmd := exec.Command("popo", "json")
output, _ := cmd.Output()
var data map[string]interface
json.Unmarshal(output, &data)
π Data Points
Each report includes:
Seismic Activity (Last 24 Hours)
- Exhalations - Low-intensity volcanic gas emissions
- Explosions - Violent eruption events
- Volcanotectonic Events - Earthquake-like events from magma movement
- Tremor Minutes - Continuous volcanic tremor duration
- High-frequency tremor breakdown
- Harmonic tremor breakdown
Alert Status
- Alert Level - Green, Yellow, Orange, or Red
- Alert Phase - Detailed phase information (e.g., "AMARILLO FASE 2")
Environmental Data
- Wind Direction - 16-point compass direction of volcanic plume
- SOβ Emissions - Sulfur dioxide emission rate (tons/day)
Media & Sources
- Images - Webcam images from volcano monitoring stations
- Videos - Time-lapse or event videos
- Source URL - Direct link to CENAPRED report
- Timestamps - Report date and scrape time
π Example Output
Human-Readable Format (popo latest)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β POPOCATΓPETL VOLCANO MONITORING REPORT β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π
Report Date: 2025-10-06
π Report Time: 2025-10-07 01:27:20 UTC
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
SEISMIC ACTIVITY (Last 24 Hours)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π¨ Exhalations: 15
π₯ Explosions: 0
π Volcanotectonic events: 0
β±οΈ Total tremor: 53 minutes
ββ High frequency: 39 minutes
ββ Harmonic: 14 minutes
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ALERT STATUS
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π‘ Alert Level: Yellow
π Phase: AMARILLO - FASE 2
JSON Format (popo json)
ποΈ Architecture
Technology Stack
- Rust - High-performance systems programming language
- reqwest - HTTP client for fetching reports
- scraper - HTML parsing with CSS selectors
- clap - Command-line argument parsing
- serde - Serialization/deserialization framework
- chrono - Date and time handling
How It Works
- Fetches the latest report from CENAPRED's technical report system
- Parses HTML content including JavaScript-generated Google Charts data
- Extracts structured data using CSS selectors and regex patterns
- Validates and transforms data into type-safe Rust structures
- Outputs in requested format (human-readable or JSON)
The scraper is resilient to:
- Multiple HTML formats (handles both static tables and JS-rendered charts)
- Various date formats (Spanish long-form and ISO dates)
- Missing optional fields (graceful degradation)
- Network issues (proper error handling with retry logic)
π§ͺ Development
Running Tests
All tests include:
- Unit tests for date parsing (Spanish months, multiple formats)
- Wind direction parsing (16 compass directions in Spanish)
- Alert level extraction
- HTML fixture parsing
- Live scraping integration test
Building
The optimized binary will be in target/release/popo.
πΊοΈ Roadmap
- Historical date queries (
popo get 2022-03-22) - SQLite storage for historical data tracking
- Date range queries (
popo range --from 2025-01-01 --to 2025-01-31) - CSV/Excel export functionality
- Notification system for alert level changes
- Historical data visualization
- GitHub Actions for daily data archival
- Multi-volcano support (if other Mexican volcanoes share the format)
π€ Contributing
Contributions welcome! This is an open-source project to provide better access to volcanic monitoring data.
Development Setup
- Fork and clone the repository
- Make your changes
- Run tests:
cargo test - Format code:
cargo fmt - Check lints:
cargo clippy - Submit a pull request
π License
MIT License - see LICENSE for details
π Acknowledgments
- CENAPRED (Centro Nacional de PrevenciΓ³n de Desastres) - For providing public volcanic monitoring data
- UNAM (Universidad Nacional AutΓ³noma de MΓ©xico) - For collaborative volcano monitoring
- The Rust community for excellent libraries and tooling
β οΈ Disclaimer
This tool scrapes publicly available data from CENAPRED's website. It is not affiliated with or endorsed by CENAPRED or UNAM. For official volcanic alerts and safety information, always refer directly to CENAPRED's official sources.
Safety First: Volcano monitoring data should be used for informational purposes only. Always follow official evacuation orders and safety guidelines from local authorities.
π Contact
- Author: Kyle Edward Donaldson
- Repository: https://github.com/KyleEdwardDonaldson/PopoCLI
- Issues: https://github.com/KyleEdwardDonaldson/PopoCLI/issues
Made with π¦ Rust and β€οΈ for volcano science