Skip to content

Instantly share code, notes, and snippets.

import rds_config
import mysql.connector
import csv
connection = None
# create connection to MySQL database
try:
connection = mysql.connector.connect(user=rds_config.db_username,
import psycopg2
from psycopg2 import extras
# ? might import this upstream in utils if I add the distinct function
# have to think about this and the dependency relationships
import pandas as pd
from database.db import local_dbc
from utils import get_distinct_artist_id
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
library(baseballr)
library(tidyr)
#standings_on_date_bref("2015-08-01","NL East", from = FALSE)
getwd()
setwd('/Users/jpurrutia/Desktop/rfdb/tables')
df = read.csv('id_vector.csv')
@jpurrutia
jpurrutia / app.py
Last active June 23, 2020 14:36
Flask App Code
from flask import Flask, request, render_template, redirect, url_for
from form import CoefficientsForm
from utils import calculate_roots, save_to_db
app = Flask(__name__)
app.config['SECRET_KEY'] = '123'
@app.route('/', methods=['GET', 'POST'])
def calculate():
form = CoefficientsForm()