Table of Contents

Generating CKAN reports

Who is this guide for

What this guide teaches

Things to know beforehand

Setting up your machine to be able to execute the script

Depending on the operating system you are using, you would need to do the following:

- OSX and Linux users do not need to install any additional software but only be familiar with the Terminal console shipped with all operating system versions. - Windows users will need to install terminal software such as https://putty.org/ in order to execute the script.

Cloning or downloading the library of scripts from the data_workstream repostory

Within the data_workstream repository on the OpenDevelopmentMekong github organization, many different utility scripts and other pieces of code can be found and used for several purposes.

There are two ways to download them:

  1. Download the zip file from the following link. After downloading the .zip file, please extract it to the folder of your choice.
  2. Clone the code repository using your favourite git client (advanced)

Configuring the reporting parameters

The following parameters can be configured:

  1. DATE_FROM: The initial date of the timeframe to get the reports about (e.g: 2017-06-01)
  2. DATE_TO: The final date of the timeframe to get the reports about (e.g: 2017-12-31)
  3. PRIVATE: Whether to gather private or public records (e.g: True)
  4. FILE_NAME: The filename to store the results of the script.

In order to configure this parameters, the file datasets_by_taxonomy.sh needs to be opened with a text or code editor. The variables can be found on lines 5-8.

These parameters need to be adapted prior to the execution of the script to make sure that the results contained the wished data.

Executing the script

Once configured, the script can now executed. In order to do so:

  1. Make sure the file datasets_by_taxonomy.sh has execution permissions.
  2. Get the PostgreSQL Production password from the password manager system and copy it.
  3. Run the script via the following command:
./datasets_by_taxonomy.sh POSTGRESQL_PASS

where POSTGRESQL_PASS is the password copied on step 2.

The script will run for some time (depending on the power of the computer and the network connection) and generate a CSV file with the filename specified on the parameters.