Skip to content

Repository containing scripts that merge data from external sources into our databases

Notifications You must be signed in to change notification settings

bhklab/lab-website-data-refresh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Refresh Script for Lab Website

Script built to sync new/current records from google sheets for presentations, publications, and preprints into mongodb that will then surface on the lab website. This script is deployed to run Monday-Friday at 5:00 A.M (EST) on the lab server as a cron job.

Requirements

  • pixi

Quickstart

Navigate to the root directory of the repo and run the following command:

pixi install
  • It is key to note that a service account is needed along with its credentials in a json file to run this script. The sheet you wish to read from on google also needs to be shared with the service account so it has proper access. Other envirnoment variables need to be setup as listed in 'scripts/conversion.py' (ie. mongodb connection string).

  • Place the .env file in the root of the project environment along with the service account json file. Once this is done, enter the following to run the script:

pixi run start

Outputs

As the script runs, you will be shown the number of records retrieved from the desired sheet and of the different actions being taken on each collection. ie. { 'upserted': 21, 'modified': 15, 'matched': 15 }

About

Repository containing scripts that merge data from external sources into our databases

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages