npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

psgc2

v2018.3.31-v4

Published

Official Philippine Standard Geographic Code (PSGC)

Downloads

20

Readme

psgc2

Official Philippine Standard Geographic Code (PSGC) in json formats.

Contains all the latest regions, provinces, cities, municipalities and barangays.

This library allows you to:

  1. Use pre-compiled JSON sets of regions, provinces, cities, municipalities and barangays.
const psgc2 = require('psgc2');
// Documented below
  1. Parse & generate latest JSON's from the official PSGC Excel (xlsx) file provided quarterly by the Philippine Statistics Authority (PSA) at http://nap.psa.gov.ph/activestats/psgc/default.asp.
// configure xlsx path first @ /build.js, then:
npm run build

Usage

const psgc2 = require('psgc2');
// {
//   raw,  // Array
//   tree,  // Object
//   regions,  // Array
//   provinces,  // Array
//   cities,  // Array
//   municipalities, // Array
// }

Structure

psgc2.raw, ~/psgc2/raw.json Array

  • Raw worksheet rows from PSGC Publication xlsx file.

psgc2.tree, ~/psgc2/tree.json Object

  • Complete JSON structured tree.
  • Used objects for hierarchical structure, easier to iterate and sort.
  • [ Region Name ] Object
    • population Integer
    • notes String (if provided by PSA)
    • [ Province Name ] Object
      • population Integer
      • notes String (if provided by PSA)
      • [ City / Municipality Name ] Object
        • population Integer
        • notes String (if provided by PSA)
        • class String, either
          • 'City'
          • 'Municipality'
        • cityClass if class=City only, String, either:
          • 'Component City'
          • 'Independent Component City'
          • 'Highly Urbanized City'
        • [ Barangay Name ]
          • population Integer
          • notes String (if provided by PSA)
          • district String
          • subMunicipality String

psgc2.regions, ~/psgc2/regions.json Array

  • Object
    • name String, region name
    • population Integer
    • notes String (if provided by PSA)

psgc2.provinces, ~/psgc2/provinces.json Array

  • Object
    • name String, province name
    • population Integer
    • notes String (if provided by PSA)
    • region String, region name

psgc2.cities, ~/psgc2/cities.json Array

  • Object
    • name String, city name
    • population Integer
    • notes String (if provided by PSA)
    • province String, province name
    • region String, region name

psgc2.municipalities, ~/psgc2/municipalities.json Array

  • Object
    • name String, municipality name
    • population Integer
    • notes String (if provided by PSA)
    • province String, province name
    • region String, region name

Changelog

  • 2018.3.31-v4
    • Fixed regions.json structure, from String -> Object.
  • 2018.3.31-v3
    • Regex-based approach on parsing population field.
    • Population field is now a purely Integer field.
    • Added notes field to contain PSA notes from population field, particularly on Provinces in this version.
    • Removed title-case transforms on Region names (better).
    • Removed title-case transforms on Barangay names (redundant).
  • 2018.3.31-v2
    • Reduced package size
  • 2018.3.31-v1
    • README updates
  • 2018.3.31
    • First working version.

PSGC Publication Info

Title

Philippine Standard Geographic Code (PSGC)

Originator

Philippine Statistics Authority (PSA)

Publication Date

31 March 2018

Abstract

The Philippine Standard Geographic Code (PSGC) is a systematic classification and coding of geographic areas in the Philippines. It is based on the four (4) well-established hierarchical levels of geographical-political subdivisions of the country, namely, the administrative region, the province, the municipality/city, and the barangay.

Process

The PSGC is updated based on the official changes occuring in the administrative structure of the country through Republic Acts and local ordinances ratified through plebiscites conducted by the COMELEC.

Progress

Ongoing (updated quarterly)

Access Constraints

None

Use constraints

Acknowledgement of the Philippine Statistics Authority (PSA) as the source


Versioning

Since this package is date-sensitive, version is based from the format:

  • YEAR . MONTH . DATE, such as 2018.3.31.

Dev Dependencies

  • xlsx @ npm
    • Parsing of xlsx files
  • case @ npm
    • Title-casing of geographic names.

License (psgc2 library)

Attribution 4.0 International (CC BY 4.0)

  • https://creativecommons.org/licenses/by/4.0/
  • https://creativecommons.org/licenses/by/4.0/legalcode.txt

cc by