hguenot/oecd-pib

There is no license information available for the latest version (V1.0.1) of this package.

Wrapper for PIB csv from https://data.oecd.org/fr/gdp/produit-interieur-brut-pib.htm

V1.0.1 2023-03-14 20:57 UTC

This package is auto-updated.

Last update: 2024-04-14 23:34:54 UTC


README

This package is a PHP wrapper for csv coming from https://data.oecd.org/fr/gdp/produit-interieur-brut-pib.htm.

Installation

Install using composer :

composer require hguenot/oecd-pib

Usage

The package offers only one singleton class \data\oecd\pib\PibDb.

Use the getInstance method to get the instance.

  • getCountries list all available countries in the file

    It returns an array of string

  • getYears list all available years in the file

    It returns an array of int

  • getAll retrieves all PIB data

  • getValuesForCountry list all values for a specific country, order by year

  • getValuesForYear list all values for a specific year, order by country

  • getLatestValues list last available values indexed by country

The last methods returns an iterable. Each value is an associative array :

  • LOCATION: Country code
  • INDICATOR: Always "GDP"
  • SUBJECT: always "TOT"
  • MEASURE:
    • "USD_CAP" (USD per Capita)
    • "MLN_USD" (Million USD)
  • FREQUENCY: always "A"
  • TIME: the year
  • Value: The PIB value
  • Flag Codes: ?