A tool to download earthquake report information from the Philippine Institute of Volcanology and Seismology (PHIVOLCS) website.
Project description
pylindol
pylindol is a lightweight and easy-to-use library designed to scrape or pull the latest earthquake data from the Philippine Institute of Volcanology and Seismology (PHIVOLCS) website. It provides a simple API to get up-to-date information for your applications, scripts, or research projects.
Requirements
- Python >= 3.11
Installation
Install pylindol directly from PyPI:
pip install pylindol
Using a virtual environment (recommended)
# Create a virtual environment
python3 -m venv .venv
# Activate the virtual environment
source .venv/bin/activate # On macOS/Linux
# .venv\Scripts\activate # On Windows
# Install pylindol
pip install pylindol
Using uv
If you prefer using uv for faster package management:
uv add pylindol
Usage
Command Line Interface (CLI)
The package provides the pylindol command after installation.
Basic usage (scrape current month)
pylindol
Scrape a specific month and year
pylindol --month 8 --year 2025
Specify custom output directory
pylindol --output-path my_data
Combine options
pylindol --month 9 --year 2025 --output-path archive
Get help
pylindol --help
Python Library
You can also use the scraper as a Python library in your code.
Import the class
from pylindol import PhivolcsEarthquakeInfoScraper
Scrape current month
scraper = PhivolcsEarthquakeInfoScraper()
scraper.run()
Scrape specific month and year
scraper = PhivolcsEarthquakeInfoScraper(month=8, year=2025)
scraper.run()
Specify custom output path
scraper = PhivolcsEarthquakeInfoScraper(
month=9,
year=2025,
output_path="custom/directory"
)
scraper.run()
Features
- ✅ Scrape current month's earthquake data
- ✅ Scrape historical data by month and year
- ✅ Automatic CA certificate handling for SSL connections
- ✅ Input validation (month range, year validation, and future date prevention)
- ✅ Export data to CSV format
- ✅ Structured logging with loguru
Output
The scraper saves earthquake data as CSV files with the naming convention:
phivolcs_earthquake_data_{month}_{year}.csv
Default location: data/ directory (created automatically if it doesn't exist)
Example: data/phivolcs_earthquake_data_10_2025.csv
The CSV files contain earthquake information including date, time, magnitude, location, and depth.
Development
If you want to contribute to pylindol or run it from source:
# Clone the repository
git clone git@github.com:clnhrn/pylindol.git
cd pylindol
# Install in development mode
pip install -e .
# Or using uv
uv sync
Project details
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 pylindol-0.2.0.tar.gz.
File metadata
- Download URL: pylindol-0.2.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f622097de3f7a85d958e7a767275d16ec8ae6656031ed859fbdc289beb61c90
|
|
| MD5 |
405a7113b93304f4ed20538337717481
|
|
| BLAKE2b-256 |
2546d6ebe91fbafaf12f8c01a0b1424f29a5b2db6a725a0a235bccd81a01f0a7
|
File details
Details for the file pylindol-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pylindol-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cafbf873fe6ff9275f00ad151473e96148b653edb530e7c5e007519f53ff7244
|
|
| MD5 |
4525994d7f2c229783a09e03856f9981
|
|
| BLAKE2b-256 |
25586d8034fcb08cc0b0ed738e14e17579a41efe5498a7be8e12bcc57ec5edca
|