google-api

Use google cloud translation api using api key

Use google cloud translation api using api key Question: I made myself a free account so I can experiment a little bit with Google Cloud Translation API. I generated myself a key from Service account, stored it into a json file, loaded it and everything seems to be working fine. Snippet from my code: import …

Total answers: 1

How do I list my scheduled queries via the Python google client API?

How do I list my scheduled queries via the Python google client API? Question: I have set up my service account and I can run queries on bigQuery using client.query(). I could just write all my scheduled queries into this new client.query() format but I already have many scheduled queries so I was wondering if …

Total answers: 5

How to fix: AttributeError: 'NoneType' object has no attribute 'group'

How to fix: AttributeError: 'NoneType' object has no attribute 'group' Question: I am running the following code:- from googletrans import Translator, constants from pprint import print # init the Google API translator translator = Translator() # translate a spanish text to english text (by default) translation = translator.translate("Hola Mundo") print("{} ({}) –> {} ({})".format(translation.origin, translation.src, …

Total answers: 2

ImportError: cannot import name 'search' from 'google' (unknown location)

ImportError: cannot import name 'search' from 'google' (unknown location) Question: I’m trying to repurpose some old code I found from 3 years ago, where it grabs text using an OCR, then Googles what it found. In the original code, it imports the google package using from google import google, and then using google.search(). However, when …

Total answers: 1

BigQuery Python 409 Already Exists: Table

BigQuery Python 409 Already Exists: Table Question: I’m coding a python script that writes query results to a BQ table . After the first time running the script, it always errors out after that with the following error: google.api_core.exceptions.Conflict: 409 Already Exists: Table project-id.dataset-id. I do not understand why it is attempting to create a …

Total answers: 2

Parsing google api object into pandas dataframe

Parsing google api object into pandas dataframe Question: I am trying to parse API response from GA to a Pandas DataFrame. The request (sample from Google page): def initialize_analyticsreporting(): “””Initializes an Analytics Reporting API V4 service object. Returns: An authorized Analytics Reporting API V4 service object. “”” credentials = ServiceAccountCredentials.from_json_keyfile_name( KEY_FILE_LOCATION, SCOPES) # Build the …

Total answers: 2

Collecting places using Python and Google Places API

Collecting places using Python and Google Places API Question: I want to collect the places around my city, Pekanbaru, with latlong (0.507068, 101.447777) and I will convert it to the dataset. Dataset (it contains place_name, place_id, lat, long and type columns). Below is the script that I tried. import json import urllib.request as url_req import …

Total answers: 2