Skip to content

Instantly share code, notes, and snippets.

View broschke's full-sized avatar

Bernardo Roschke broschke

View GitHub Profile
#!/usr/bin/env python
# coding: utf-8
import requests as re
import json
import cred
import time
@broschke
broschke / tableau_audit
Created March 10, 2021 12:56
Download and parse tableau server workbooks for meta data
#!/usr/bin/env python
# coding: utf-8
import xml.etree.ElementTree as ET
import tableauserverclient as TSC
import pandas as pd
import numpy as np
import os
import shutil
from pathlib import Path
#!/usr/bin/env python
# coding: utf-8
import xml.etree.ElementTree as ET
import tableauserverclient as TSC
import pandas as pd
import numpy as np
import os
import shutil
from pathlib import Path
import numpy as np
import pandas as pd
import datetime
# capture current week and same week last year
date_list = []
date = datetime.datetime.now().date()
for i in range(7):
date_list.append(date - datetime.timedelta(days=i))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@broschke
broschke / pandas_to_vertica.py
Created March 26, 2018 14:09
Snippet to move Pandas dataframe to CSV then upload to Vertica
import pandas as pd
import numpy as np
import os
import pyodbc
import time
#this is a sample dataframe created for testing
df = pd.DataFrame(np.random.randint(0,100,size=(100, 4)), columns=list('ABCD'))
#create a list of the column names
import urllib.request
import json
import sqlite3
from key import ID, SECRET
CLIENT_ID = ID
CLIENT_SECRET = SECRET
v = '20170315'
url = 'https://api.foursquare.com/v2/venues/categories?client_id='+ CLIENT_ID +'&client_secret=' + SECRET + '&v=' + v
import pandas as pd
from scipy import stats
def print_output(stat, val):
print("The {0} for the Alcohol and Tobacco dataset is {1}.".format(stat, val))
data = '''Region,Alcohol,Tobacco
North,6.47,4.03
Yorkshire,6.13,3.76
Northeast,6.19,3.77
@broschke
broschke / is_prime.py
Last active March 12, 2019 15:50
Python script that checks if a number is Prime
import math
user_num = raw_input("Enter a number: ")
num = int(user_num)
limit = int(math.sqrt(num))
result_list = []
for i in range(2,limit+1):
prime_test = num % i
@broschke
broschke / Hello World Flask
Created June 25, 2016 15:46
Hello World using Flask with Jedi name
from flask import Flask
from os import environ
app = Flask(__name__)
@app.route("/")
@app.route("/hello")
def say_hi():
return "Hello World!"