Giter Club home page Giter Club logo

lbl-get-tableau-data's Introduction

Get LBL Tableau Dashboard Data

Required external py libraries

This program uses a few external libraries, which should all be available via pip:

  1. requests: Handles HTTP requests
  2. pyodbc: Handles the SQL
  3. openpyxl: Handles XLSX excell files.
  4. Various google drive API packages.

NOTE: Required Google Drive API file: token.json

This program requires a file "token.json" to connect to the Google Drive API. (This file is on subi currenlty.) It is possible this token may expire or break at some point, and a new token.json will need to be generated. If this occurs, see Google's Python Quickstart guide. The basic workflow is: (1) Install the required Google Drive py packages; (2) run this quickstart .py program, which will prompt you to sign in to your google account; (3) This will save "credentials.json" to your hard drive, and generate "token.json"

Usage:

  • This program can be run on subi or on your desktop.
  • It is currently installed on subi staging, and chrontabbed to run monthly.
  • If you want to convert the OSTI .xslx files, download them into a folder called "input_osti_xlsx_files/". Run the program with -fy to convert these.
  • Run with -g to upload the resulting output files to LBL's "Tableau Data" google drive.

Running the program will:

  1. Create a folder inside of "output", named YYYY-MM-DD-HH-MM-SS/. All the files will be saved here.
  2. Connect to LBL's HR Feed API, and download a CSV.
  3. Connect to the Elements Reporting DB, run each of the queries contained in the "sql_queries" folder, and save a CSV for each one.
  4. If you're running with -fy, it'll check for the osti xlsx files and extract the appropriate sheet into a CSV.
  5. If you're running with -g, it'll ping the "Tableau Data" on google drive,
    1. If files with matching names exist, it'll overwrite them with the new files
    2. If they don't exist, it'll upload the new files.
  6. If you're running without -g, the output files will be available in the output folder.

lbl-get-tableau-data's People

Contributors

devinsmithwork avatar

Watchers

amy wieliczka avatar Hardy Pottinger avatar Chad Nelson avatar Esther Verreau avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.