This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, uuid | |
from io import BytesIO | |
from datetime import datetime | |
from urllib.parse import urlparse | |
from azure.storage.blob import BlobServiceClient | |
import pandas as pd | |
def azure_upload_df(container=None, dataframe=None, filename=None): | |
""" | |
Upload DataFrame to Azure Blob Storage for given container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from azure.mgmt.datafactory import DataFactoryManagementClient | |
from azure.common.credentials import UserPassCredentials #To login with user and pass, use this. | |
from azure.common.credentials import ServicePrincipalCredentials #To login with service principal (appid and client secret) use this | |
subscription_id = "subsID" | |
#Use only one of these, depending on how you want to login. | |
credentials = UserPassCredentials(username="[email protected]", password="yourpass") #To login with user and pass | |
credentials = ServicePrincipalCredentials(client_id='appid', secret='client secret', tenant='tenantid') #To login with serv ppal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install chromium, its driver, and selenium | |
!apt update | |
!apt install libu2f-udev libvulkan1 | |
!wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
!dpkg -i google-chrome-stable_current_amd64.deb | |
!wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.70/linux64/chromedriver-linux64.zip | |
!unzip -j chromedriver-linux64.zip chromedriver-linux64/chromedriver -d /usr/local/bin/ | |
!pip install selenium chromedriver_autoinstaller | |
# set options to be headless, .. |