This directory contains the code that processes the data generated in company_linkage for use in the PARAT website. It also contains a Gatsby project (gui-v2
) that implements the PARAT website.
To populate the necessary data from a raw clone of this repository:
export GOOGLE_APPLICATION_CREDENTIALS=<path to a service account with translation and BigQuery reader permissions>
.- If you want to refresh sector information,
export PERMID_API_KEY=<api key here>
. You can find an API key in GCP secret manager. - To fully regenerate everything including images and Google Finance links
(which take ~1.5 hours to generate), run:
python3 scripts/retrieve_data.py --refresh_raw --refresh_images --refresh_market_links --refresh_sector
. Runpython3 scripts/retrieve_data.py -h
for more detail on what these parameters do. - The
retrieve_data.py
script will also generate a new data zipfile for Zenodo. You can add this to 10.5281/zenodo.12520759. Please provide a semantic version string.
The new (v2) interface for PARAT is in the gui-v2/
directory. To update the tooltips, edit gui-v2/src/static_data/tooltips.js
.
To start the development server:
cd gui-v2/
npm install
npm run develop
The PARAT v2 interface will be available at localhost:8550
.
When any changes are ready for deployment, do:
npm install
gatsby clean
gatsby build
And check that everything looks like you expect. Then, copy the files in the resulting public
directory to the production GCS bucket using bash push_to_production.sh
. This script currently rebuilds the site - you can omit the build steps if you've already run them manually.
Tooltips are defined in src/static_data/tooltips.js
,
and can include React fragments and Emotion styles for design and layout.
Tooltips use the same keys as their associated data elements (example: S&P 500
data uses the sp500
key, as does the S&P 500 explainer tooltip).