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-05-14 23:40:47 UTC


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


Install using composer :

composer require hguenot/oecd-pib


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"
    • "USD_CAP" (USD per Capita)
    • "MLN_USD" (Million USD)
  • FREQUENCY: always "A"
  • TIME: the year
  • Value: The PIB value
  • Flag Codes: ?