hguenot / oecd-pib
Wrapper for PIB csv from https://data.oecd.org/fr/gdp/produit-interieur-brut-pib.htm
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/hguenot/oecd-pib
Requires
- hguenot/phpstream: ^3.0.0
- league/csv: ^9.0
Requires (Dev)
- phpunit/phpunit: 10.1.x-dev
- psy/psysh: @stable
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.
-
getCountrieslist all available countries in the fileIt returns an array of
string -
getYearslist all available years in the fileIt returns an array of
int -
getAllretrieves all PIB data -
getValuesForCountrylist all values for a specific country, order by year -
getValuesForYearlist all values for a specific year, order by country -
getLatestValueslist last available values indexed by country
The last methods returns an iterable. Each value is an associative array :
LOCATION: Country codeINDICATOR: Always "GDP"SUBJECT: always "TOT"MEASURE:- "
USD_CAP" (USD per Capita) - "
MLN_USD" (Million USD)
- "
FREQUENCY: always "A"TIME: the yearValue: The PIB valueFlag Codes: ?