This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
admin:generate_ckan_reports [2018/02/16 14:20] acorbi [Installing python runtime on your machine] |
admin:generate_ckan_reports [2020/06/23 15:05] (current) |
||
---|---|---|---|
Line 9: | Line 9: | ||
===== What this guide teaches ===== | ===== What this guide teaches ===== | ||
- | * How to run a python script which gathers reporting data from the contents stored on the ckan instance | + | * How to run a BASH script which gathers reporting data from the contents stored on the ckan instance |
* How to to clone a github repository | * How to to clone a github repository | ||
- | * How to install python runtime on any platform | ||
===== Things to know beforehand ===== | ===== Things to know beforehand ===== | ||
* This task requires some basic programming knowledge | * This task requires some basic programming knowledge | ||
- | * How to edit a python source code file | + | * How to edit a BASH source code file |
- | * How to execute a python script | + | * How to execute a BASH script |
* In order to complete this task, you will need access to the password repostory on [[https://ratticdb.proteus-tech.com:7078/|the rattic db instance maintained by Proteus]] | * In order to complete this task, you will need access to the password repostory on [[https://ratticdb.proteus-tech.com:7078/|the rattic db instance maintained by Proteus]] | ||
- | ==== Installing python runtime on your machine ==== | + | ==== Setting up your machine to be able to execute the script ==== |
- | You can download and install the latest version of python from [[https://www.python.org/downloads/|the official python site]] | + | 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 ==== | ==== Cloning or downloading the library of scripts from the data_workstream repostory ==== | ||
Line 37: | Line 38: | ||
The following parameters can be configured: | The following parameters can be configured: | ||
- | - DATE_FROM: The initial date of the timeframe to get the reports about (e.g: 2017-06-01) | + | - **DATE_FROM**: The initial date of the timeframe to get the reports about (e.g: 2017-06-01) |
- | - DATE_TO: The final date of the timeframe to get the reports about (e.g: 2017-12-31) | + | - **DATE_TO**: The final date of the timeframe to get the reports about (e.g: 2017-12-31) |
- | - PRIVATE: Whether to gather private or public records (e.g: True) | + | - **PRIVATE**: Whether to gather private or public records (e.g: True) |
- | - FILE_NAME: The filename to store the results of the script. | + | - **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. | 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. | ||
Line 48: | Line 49: | ||
These parameters need to be adapted prior to the execution of the script to make sure that the results contained the wished data. | 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: | ||
+ | |||
+ | - Make sure the file **datasets_by_taxonomy.sh** has execution permissions. | ||
+ | - Get the [[https://ratticdb.proteus-tech.com:7078/cred/detail/197/|PostgreSQL Production]] password from the password manager system and copy it. | ||
+ | - Run the script via the following command: | ||
+ | |||
+ | <code>./datasets_by_taxonomy.sh POSTGRESQL_PASS</code> | ||
+ | |||
+ | 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. |