Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
Auto-update dependencies. [(#735)](GoogleCloudPlatform/python-docs-sa…
Browse files Browse the repository at this point in the history
…mples#735)

* Auto-update dependencies.
* Fix language OCR sample
* Remove unused import
  • Loading branch information
dpebot authored and busunkim96 committed Sep 29, 2020
1 parent 7a9c44e commit 662ca4f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion samples/snippets/api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-api-python-client==1.5.5
google-api-python-client==1.6.1
2 changes: 1 addition & 1 deletion samples/snippets/movie_nl/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
google-api-python-client==1.5.5
google-api-python-client==1.6.1
requests==2.12.4
14 changes: 2 additions & 12 deletions samples/snippets/ocr_nl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

from googleapiclient import discovery
from googleapiclient import errors
import httplib2
from oauth2client.client import GoogleCredentials

BATCH_SIZE = 10

Expand All @@ -54,8 +52,7 @@ class VisionApi(object):
"""Construct and use the Cloud Vision API service."""

def __init__(self):
credentials = GoogleCredentials.get_application_default()
self.service = discovery.build('vision', 'v1', credentials=credentials)
self.service = discovery.build('vision', 'v1')

def detect_text(self, input_filenames, num_retries=3, max_results=6):
"""Uses the Vision API to detect text in the given file."""
Expand Down Expand Up @@ -113,14 +110,7 @@ class TextAnalyzer(object):
"""Construct and use the Google Natural Language API service."""

def __init__(self, db_filename=None):
credentials = GoogleCredentials.get_application_default()
scoped_credentials = credentials.create_scoped(
['https://www.googleapis.com/auth/cloud-platform'])
http = httplib2.Http()
scoped_credentials.authorize(http)
self.service = discovery.build('language', 'v1',
http=http,
credentials=credentials)
self.service = discovery.build('language', 'v1')

# This list will store the entity information gleaned from the
# image files.
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/ocr_nl/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-api-python-client==1.5.5
google-api-python-client==1.6.1
2 changes: 1 addition & 1 deletion samples/snippets/syntax_triples/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-api-python-client==1.5.5
google-api-python-client==1.6.1
2 changes: 1 addition & 1 deletion samples/snippets/tutorial/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-api-python-client==1.5.5
google-api-python-client==1.6.1

0 comments on commit 662ca4f

Please sign in to comment.