Name: ibp-explorer-data-client
Owner: Open Knowledge International
Description: A dedicated data client for the IBP Explorer (works with S3, Google Sheets, and Amida to get data)
Created: 2016-08-30 08:07:51.0
Updated: 2017-09-06 07:59:41.0
Pushed: 2018-01-15 13:36:54.0
Size: 62
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A Javascript client for data client needed by ibp-explorer. Works with Indaba API, S3 and Google Drive and Spreadsheets to set or get data.
git clone https://github.com/okfn/ibp-explorer-data-client.git
In order to use ibp-explorer-data-client the following environment variables need to be set:
export SERVICE_CREDENTIALS=`cat <path_to_credentials.json>`
The Indaba API_TOKEN
is time-limited. When this lib is used by the separate ibp-explorer library, a valid token is refreshed and obtained automatically. See the note below on how to obtain a token for testing this library outside of its use with ibp-explorer.
Budget Documents are archived in a Google Drive directory, and a Google Sheets document acts as a catalogue to map the location of these documents with their relevant country/dataset. This catalogue is used to create the correct links in the Document Availability section of the Explorer.
You can populate the spreadsheet by running:
npm run populate-gdrive-spreadsheet
These environment variables need to be set to populate a spreadsheet:
Snapshot is the current state of the available documents that is used for displaying historical information about a country. They are stored on S3.
To upload the initial (old) snapshots available from the API run npm run upload-base-snapshots
To create a snapshot from the current state of available documents run npm run update-snapshots
Tests are run with npm test
. A valid Indaba API token will need to be added to the test environment for tests to pass. One way to obtain a valid token is to echo out the process.env.API_TOKEN
when running the getTrackerJSON
method from the ibp-explorer codebase (this is clearly not a great procedure, but if you want to test, that's how to get a valid token). Once obtained, this can be added to the .env file for local testing, and to the Travis environment. The token is time-limited and will eventually expire.