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 sys | |
from PyQt5.QtWidgets import QWidget, QDesktopWidget, QApplication | |
class Demo(QWidget): | |
def __init__(self): | |
super().__init__() | |
self.initUI() | |
def initUI(self): | |
self.setWindowTitle('Center the app') |
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, io | |
import re | |
from google.cloud import vision | |
from google.cloud import storage | |
from google.protobuf import json_format | |
""" | |
# pip install --upgrade google-cloud-storage | |
""" | |
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r'ServiceAccountToken.json' |
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, io | |
from google.cloud import vision | |
from google.cloud.vision import types | |
import pandas as pd | |
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r'ServiceAccountToken.json' | |
client = vision.ImageAnnotatorClient() | |
FOLDER_PATH = r'<Folder Path>' | |
IMAGE_FILE = '<image file name>' |
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 googleapiclient.discovery import build | |
import pandas as pd | |
API_SERVICE_NAME = 'discovery' | |
API_VERSION = 'v1' | |
service = build(API_SERVICE_NAME, API_VERSION) | |
api_service = service.apis() | |
df_list = pd.DataFrame(api_service.list().execute().get('items')) | |
print(df_list) |
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 pickle | |
import os | |
from google_auth_oauthlib.flow import Flow, InstalledAppFlow | |
from googleapiclient.discovery import build | |
from google.auth.transport.requests import Request | |
def Create_Service(client_secret_file, api_service_name, api_version, *scopes): | |
SCOPES = [scope for scope in scopes[0]] | |
print(SCOPES) | |
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 pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
df = pd.DataFrame({ | |
'a': np.random.randint(0, 5, size=5), | |
'b': np.random.randint(0, 5, size=5), | |
'c': np.random.randint(0, 5, size=5) | |
}) |
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, io | |
from google.cloud import vision | |
from google.cloud.vision import types | |
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r'ServiceAccountToken.json' | |
client = vision.ImageAnnotatorClient() |
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 win32com.client as win32 | |
from Google import Create_Service | |
CLIENT_SECRET_FILE = 'client_secret.json' | |
API_SERVICE_NAME = 'sheets' | |
API_VERSION = 'v4' | |
SCOPES = ['https://www.googleapis.com/auth/spreadsheets.readonly'] | |
gsheet_id = '<Google Sheets Id>' | |
gsheet_name = 'sheet1' |
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
Sub SearchEmails() | |
Dim olNS As NameSpace | |
Dim FolderInbox As MAPIFolder | |
Dim filtered_items As Items | |
Dim olMail As MailItem | |
Dim strFilter As String | |
Set olNS = GetNamespace("MAPI") | |
Set FolderInbox = olNS.GetDefaultFolder(olFolderInbox) |
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 Google import Create_Service | |
import win32com.client as win32 | |
xlApp = win32.Dispatch('Excel.Application') | |
wb = xlApp.Workbooks.Open(r"<Excel File Path>") | |
ws = wb.Worksheets('<Worksheet Name>') | |
rngData = ws.Range('A1').CurrentRegion() | |
# Google Sheet Id | |
gsheet_id = '<Google Sheet Id>' |