The PAGASA Parser was developed due to the lack of an easy-to-use API to grab active
PAGASA Tropical Cyclone Bulletins (TCBs). The core library, pagasa-parser
,
is able to transcribe a standard list of areas like this:
The rest of mainland Cagayan, the eastern portion of Ilocos Norte (Pagudpud, Adams, Dumalneg, Bangui, Vintar, Carasi, Nueva Era, Burgos, Pasuquin, Bacarra, Laoag City, Piddig, Solsona, Dingras, Sarrat, San Nicolas), the rest of Apayao, the northern portion of Kalinga (Balbalan, Pinukpuk, City of Tabuk, Rizal), the eastern portion of Mountain Province (Paracelis), the northeastern portion of Abra (Tineg, Lacub, Malibcong), the northwestern and southeastern portions of Isabela (Santa Maria, Quezon, Mallig, Roxas, San Manuel, Cabatuan, Aurora, City of Cauayan, Angadanan, San Guillermo, Dinapigue, San Mariano, Cabagan, Santo Tomas, Delfin Albano, Tumauini, Quirino, Burgos, Gamu, Ilagan City, Luna, Reina Mercedes, Naguilian, Benito Soliven), and the northern portion of Aurora (Dilasag, Casiguran)
to this:
{
"areas": {
"0": [
{
"name": "Cagayan",
"part": true,
"includes": {
"type": "rest",
"term": "mainland"
}
},
{
"name": "Ilocos Norte",
"part": true,
"includes": {
"type": "section",
"term": "portion",
"part": "eastern",
"objects": [
"Pagudpud",
"Adams",
"Dumalneg",
"Bangui",
"Vintar",
"Carasi",
"Nueva Era",
"Burgos",
"Pasuquin",
"Bacarra",
"Laoag City",
"Piddig",
"Solsona",
"Dingras",
"Sarrat",
"San Nicolas"
]
}
},
{
"name": "Apayao",
"part": true,
"includes": {
"type": "rest"
}
},
{
"name": "Kalinga",
"part": true,
"includes": {
"type": "section",
"term": "portion",
"part": "northern",
"objects": [
"Balbalan",
"Pinukpuk",
"City of Tabuk",
"Rizal"
]
}
},
{
"name": "Mountain Province",
"part": true,
"includes": {
"type": "section",
"term": "portion",
"part": "eastern",
"objects": [
"Paracelis"
]
}
},
{
"name": "Abra",
"part": true,
"includes": {
"type": "section",
"term": "portion",
"part": "northeastern",
"objects": [
"Tineg",
"Lacub",
"Malibcong"
]
}
},
{
"name": "Isabela",
"part": true,
"includes": {
"type": "section",
"term": "portion",
"part": "northwestern and southeastern",
"objects": [
"Santa Maria",
"Quezon",
"Mallig",
"Roxas",
"San Manuel",
"Cabatuan",
"Aurora",
"City of Cauayan",
"Angadanan",
"San Guillermo",
"Dinapigue",
"San Mariano",
"Cabagan",
"Santo Tomas",
"Delfin Albano",
"Tumauini",
"Quirino",
"Burgos",
"Gamu",
"Ilagan City",
"Luna",
"Reina Mercedes",
"Naguilian",
"Benito Soliven"
]
}
},
{
"name": "Aurora",
"part": true,
"includes": {
"type": "section",
"term": "portion",
"part": "northern",
"objects": [
"Dilasag",
"Casiguran"
]
}
}
],
"1": [],
"2": []
}
}
Special packages, like source-pdf
can also transcribe files
directly, such as PAGASA's Tropical Cyclone Bulletin PDF files.
import PagasaParserPDFSource from "@pagasa-parser/source-pdf";
const data = new PagasaParserPDFSource(path.join(__dirname, "bulletin.pdf"));
data.parse().then(console.log);
All packages are written in JavaScript and are available on npm. Since PAGASA bulletins are under public domain, any data generated by the PAGASA Parser is also part of the public domain, as it is merely derivative works of the original data. This means you can do anything you wish with the formatted data, whether it be inclusion in a website, processing into specialized graphics, or usage in news reports. Attribution of this project is not required, but is appreciated by the developers.
If you'd like to support this website or the project, consider visiting the pagasa-parser-web GitHub repository to view sponsorship options.