airbyte-source-google-sheets 0.7.4__tar.gz → 0.8.5__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/PKG-INFO +4 -3
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/pyproject.toml +1 -1
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/source_google_sheets/client.py +4 -11
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/source_google_sheets/helpers.py +3 -1
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/source_google_sheets/source.py +5 -3
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/source_google_sheets/utils.py +1 -0
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/README.md +0 -0
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/source_google_sheets/__init__.py +0 -0
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/source_google_sheets/models/__init__.py +0 -0
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/source_google_sheets/models/spreadsheet.py +0 -0
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/source_google_sheets/models/spreadsheet_values.py +0 -0
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/source_google_sheets/run.py +0 -0
- {airbyte_source_google_sheets-0.7.4 → airbyte_source_google_sheets-0.8.5}/source_google_sheets/spec.yaml +0 -0
@@ -1,8 +1,7 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.3
|
2
2
|
Name: airbyte-source-google-sheets
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.8.5
|
4
4
|
Summary: Source implementation for Google Sheets.
|
5
|
-
Home-page: https://airbyte.com
|
6
5
|
License: Elv2
|
7
6
|
Author: Airbyte
|
8
7
|
Author-email: contact@airbyte.io
|
@@ -12,11 +11,13 @@ Classifier: Programming Language :: Python :: 3
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.10
|
13
12
|
Classifier: Programming Language :: Python :: 3.11
|
14
13
|
Classifier: Programming Language :: Python :: 3.12
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
15
15
|
Requires-Dist: Unidecode (==1.3.8)
|
16
16
|
Requires-Dist: airbyte-cdk (>=4,<5)
|
17
17
|
Requires-Dist: google-api-python-client (==2.114.0)
|
18
18
|
Requires-Dist: google-auth-httplib2 (==0.2.0)
|
19
19
|
Project-URL: Documentation, https://docs.airbyte.com/integrations/sources/google-sheets
|
20
|
+
Project-URL: Homepage, https://airbyte.com
|
20
21
|
Project-URL: Repository, https://github.com/airbytehq/airbyte
|
21
22
|
Description-Content-Type: text/markdown
|
22
23
|
|
@@ -11,6 +11,7 @@ from requests import codes as status_codes
|
|
11
11
|
|
12
12
|
from .helpers import SCOPES, Helpers
|
13
13
|
|
14
|
+
|
14
15
|
logger = logging.getLogger("airbyte")
|
15
16
|
|
16
17
|
|
@@ -33,24 +34,16 @@ class GoogleSheetsClient:
|
|
33
34
|
def __init__(self, credentials: Dict[str, str], scopes: List[str] = SCOPES):
|
34
35
|
self.client = Helpers.get_authenticated_sheets_client(credentials, scopes)
|
35
36
|
|
36
|
-
def _create_range(self, sheet, row_cursor):
|
37
|
-
range = f"{sheet}!{row_cursor}:{row_cursor + self.Backoff.row_batch_size}"
|
38
|
-
return range
|
39
|
-
|
40
37
|
@backoff.on_exception(backoff.expo, errors.HttpError, max_time=120, giveup=Backoff.give_up, on_backoff=Backoff.increase_row_batch_size)
|
41
38
|
def get(self, **kwargs):
|
42
39
|
return self.client.get(**kwargs).execute()
|
43
40
|
|
44
|
-
@backoff.on_exception(backoff.expo, errors.HttpError, max_time=120, giveup=Backoff.give_up, on_backoff=Backoff.increase_row_batch_size)
|
45
|
-
def create(self, **kwargs):
|
46
|
-
return self.client.create(**kwargs).execute()
|
47
|
-
|
48
41
|
@backoff.on_exception(backoff.expo, errors.HttpError, max_time=120, giveup=Backoff.give_up, on_backoff=Backoff.increase_row_batch_size)
|
49
42
|
def get_values(self, **kwargs):
|
50
43
|
range = self._create_range(kwargs.pop("sheet"), kwargs.pop("row_cursor"))
|
51
44
|
logger.info(f"Fetching range {range}")
|
52
45
|
return self.client.values().batchGet(ranges=range, **kwargs).execute()
|
53
46
|
|
54
|
-
|
55
|
-
|
56
|
-
return
|
47
|
+
def _create_range(self, sheet, row_cursor):
|
48
|
+
range = f"{sheet}!{row_cursor}:{row_cursor + self.Backoff.row_batch_size}"
|
49
|
+
return range
|
@@ -9,14 +9,16 @@ from collections import defaultdict
|
|
9
9
|
from datetime import datetime
|
10
10
|
from typing import Dict, FrozenSet, Iterable, List, Tuple
|
11
11
|
|
12
|
-
from airbyte_cdk.models.airbyte_protocol import AirbyteRecordMessage, AirbyteStream, ConfiguredAirbyteCatalog, SyncMode
|
13
12
|
from google.oauth2 import credentials as client_account
|
14
13
|
from google.oauth2 import service_account
|
15
14
|
from googleapiclient import discovery
|
16
15
|
|
16
|
+
from airbyte_cdk.models.airbyte_protocol import AirbyteRecordMessage, AirbyteStream, ConfiguredAirbyteCatalog, SyncMode
|
17
|
+
|
17
18
|
from .models.spreadsheet import RowData, Spreadsheet
|
18
19
|
from .utils import safe_name_conversion
|
19
20
|
|
21
|
+
|
20
22
|
SCOPES = ["https://www.googleapis.com/auth/spreadsheets.readonly", "https://www.googleapis.com/auth/drive.readonly"]
|
21
23
|
|
22
24
|
logger = logging.getLogger("airbyte")
|
@@ -8,6 +8,10 @@ import logging
|
|
8
8
|
import socket
|
9
9
|
from typing import Any, Generator, List, Mapping, MutableMapping, Optional, Union
|
10
10
|
|
11
|
+
from apiclient import errors
|
12
|
+
from google.auth import exceptions as google_exceptions
|
13
|
+
from requests.status_codes import codes as status_codes
|
14
|
+
|
11
15
|
from airbyte_cdk.models import FailureType
|
12
16
|
from airbyte_cdk.models.airbyte_protocol import (
|
13
17
|
AirbyteCatalog,
|
@@ -24,9 +28,6 @@ from airbyte_cdk.sources.source import Source
|
|
24
28
|
from airbyte_cdk.sources.streams.checkpoint import FullRefreshCheckpointReader
|
25
29
|
from airbyte_cdk.utils import AirbyteTracedException
|
26
30
|
from airbyte_cdk.utils.stream_status_utils import as_airbyte_message
|
27
|
-
from apiclient import errors
|
28
|
-
from google.auth import exceptions as google_exceptions
|
29
|
-
from requests.status_codes import codes as status_codes
|
30
31
|
|
31
32
|
from .client import GoogleSheetsClient
|
32
33
|
from .helpers import Helpers
|
@@ -34,6 +35,7 @@ from .models.spreadsheet import Spreadsheet
|
|
34
35
|
from .models.spreadsheet_values import SpreadsheetValues
|
35
36
|
from .utils import exception_description_by_status_code, safe_name_conversion
|
36
37
|
|
38
|
+
|
37
39
|
# override default socket timeout to be 10 mins instead of 60 sec.
|
38
40
|
# on behalf of https://github.com/airbytehq/oncall/issues/242
|
39
41
|
DEFAULT_SOCKET_TIMEOUT: int = 600
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|