A set of scripts that fetch data from different sources and parses this data to be exported or uploaded to other sources in the Powerhouse data structures.
In order to run the scripts you need to:
- Create a Google
OAUTH 2.0 Client IDcredentials file and have it in the root of this repo, namedcredentials.json- Make sure to allow spreadsheet read access to your settings so that the script will be able to read from your spreadsheet.
- Follow this link for instructions.
- export the database connection as an
envvariable. The env var name being:PG_CONNECTION_STRING - Run:
yarn install - Run:
yarn build
-
Budget Statement Expense Line Items: fetches expense lineitems from a google spreadsheet, that Ecosysem Actors or Core Units within MakerDAO use to report their expenses, amd exports the summary into a Budget Statement Document Model.
- In
src\budgetStatement\main.tschange the params in theExportToFileobject andrunWithParamsfunction to match your needs. - Run
yarn budgetDocumentto run the script.
- In
-
Analytics Generator Script - generates analytics series into the database, it gets the below registered data types and parses it into the analytics series and uploads it to the respective tables in the database. Below is the list of different data types that you can add.
budget-statementsline items:- The path being:
powerhouse/legacy-api/budget-statements, if you want to add only a specific budget statement then add a/budgetStatementIdat the end of the path. Like so:powerhouse/legacy-api/budget-statements/1,1being the budget statement id.
- The path being:
mip40line items:- The path being:
powerhouse/legacy-api/mip40, if you want to add only a specific mip40 then add a/mip40Spnat the end of the path. Like so:powerhouse/legacy-api/mip40/MIP40c3SP26,MIP40c3SP26being the mip40Spn.
- The path being:
snapshot-reportsline items:- The path being:
powerhouse/legacy-api/snapshot-reports, if you want to add only a specific snapshot report then add a/snapshotReportIdat the end of the path. Like so:powerhouse/legacy-api/snapshot-reports/1,1being the snapshot report id.
- The path being:
google-sheet: atlas budget scope artifacts google spreadsheet.powerhouse: runs all analytics series scripts together.- By running
yarn generate-analytics powerhouseyou will run all the above scripts together.
- By running
To run the script, you need to write the specified path and then run the following command with the specified path:
yarn generate-analytics <specified path>