airbyte-source-google-search-console 1.6.0.dev202503282247__py3-none-any.whl → 1.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {airbyte_source_google_search_console-1.6.0.dev202503282247.dist-info → airbyte_source_google_search_console-1.7.0.dist-info}/METADATA +4 -4
- airbyte_source_google_search_console-1.7.0.dist-info/RECORD +22 -0
- {airbyte_source_google_search_console-1.6.0.dev202503282247.dist-info → airbyte_source_google_search_console-1.7.0.dist-info}/WHEEL +1 -1
- source_google_search_console/components.py +81 -0
- source_google_search_console/config_migrations.py +4 -1
- source_google_search_console/manifest.yaml +828 -0
- source_google_search_console/run.py +47 -9
- source_google_search_console/service_account_authenticator.py +3 -1
- source_google_search_console/source.py +23 -59
- source_google_search_console/spec.json +7 -0
- source_google_search_console/streams.py +1 -121
- airbyte_source_google_search_console-1.6.0.dev202503282247.dist-info/RECORD +0 -29
- source_google_search_console/schemas/search_analytics_by_country.json +0 -41
- source_google_search_console/schemas/search_analytics_keyword_page_report.json +0 -54
- source_google_search_console/schemas/search_analytics_keyword_page_report_minimal_dimensions.json +0 -54
- source_google_search_console/schemas/search_analytics_keyword_site_report_by_page.json +0 -50
- source_google_search_console/schemas/search_analytics_keyword_site_report_by_page_minimal_dimensions.json +0 -50
- source_google_search_console/schemas/search_analytics_keyword_site_report_by_site.json +0 -50
- source_google_search_console/schemas/search_analytics_keyword_site_report_by_site_minimal_dimensions.json +0 -50
- source_google_search_console/schemas/sitemaps.json +0 -61
- source_google_search_console/schemas/sites.json +0 -14
- {airbyte_source_google_search_console-1.6.0.dev202503282247.dist-info → airbyte_source_google_search_console-1.7.0.dist-info}/entry_points.txt +0 -0
@@ -1,19 +1,19 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: airbyte-source-google-search-console
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.7.0
|
4
4
|
Summary: Source implementation for Google Search Console.
|
5
5
|
License: Elv2
|
6
6
|
Author: Airbyte
|
7
7
|
Author-email: contact@airbyte.io
|
8
|
-
Requires-Python: >=3.
|
8
|
+
Requires-Python: >=3.10,<3.12
|
9
9
|
Classifier: License :: Other/Proprietary License
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
11
|
-
Classifier: Programming Language :: Python :: 3.9
|
12
11
|
Classifier: Programming Language :: Python :: 3.10
|
13
12
|
Classifier: Programming Language :: Python :: 3.11
|
14
|
-
Requires-Dist: airbyte-cdk (>=
|
13
|
+
Requires-Dist: airbyte-cdk (>=6,<7)
|
15
14
|
Requires-Dist: google-api-python-client (==2.105.0)
|
16
15
|
Requires-Dist: google-auth (==2.23.3)
|
16
|
+
Requires-Dist: pendulum (>=3.1.0,<4.0.0)
|
17
17
|
Project-URL: Documentation, https://docs.airbyte.com/integrations/sources/google-search-console
|
18
18
|
Project-URL: Homepage, https://airbyte.com
|
19
19
|
Project-URL: Repository, https://github.com/airbytehq/airbyte
|
@@ -0,0 +1,22 @@
|
|
1
|
+
source_google_search_console/__init__.py,sha256=HQCPu-CK7XmVDtP9rmTdB2XyraVCc6pv9pw38-O8y48,1191
|
2
|
+
source_google_search_console/components.py,sha256=5o8kH2xwYUvk3yjnSd6okJVF2KBUqUIF4V97xRpPAyI,2803
|
3
|
+
source_google_search_console/config_migrations.py,sha256=Cl4SUdJpAf6wMM_vVhqjjU89NfUq9LIGJ9zNrWiBk-A,4235
|
4
|
+
source_google_search_console/exceptions.py,sha256=iD3jYC4WxVCEKGsqQ7Vaj1tbjhJZ4S5mnSDnwFJdsIQ,1097
|
5
|
+
source_google_search_console/manifest.yaml,sha256=m6IhF4bRwF9nAivJev2ebB8QPvoKRbYixF-5ZKSBkms,25882
|
6
|
+
source_google_search_console/run.py,sha256=TBkPlseTERarkj6wL8AMEKgm5Xsb2drnltPVH6257-M,2195
|
7
|
+
source_google_search_console/schemas/search_analytics_all_fields.json,sha256=iQxRh_c_yz3uGofqpo1KX571TMmzYjKScb0PtI6SN_Q,1729
|
8
|
+
source_google_search_console/schemas/search_analytics_by_date.json,sha256=meCbWDayc1y0q-Lu-CAdjQVnsM8xZBX3BdF129UC1P8,1388
|
9
|
+
source_google_search_console/schemas/search_analytics_by_device.json,sha256=VtoFjmmv9rx-uhSFaRn0wm4LeSxRIaexrxg2Spvbneo,1525
|
10
|
+
source_google_search_console/schemas/search_analytics_by_page.json,sha256=KyUojZc4Lv3hPswxIJzUL5QDNsbvSugGjl_uHGF7Am4,1473
|
11
|
+
source_google_search_console/schemas/search_analytics_by_query.json,sha256=mYc1Fu1A5TWLZCApZSjjfs_urW5BRUCPQI3rw3yQjt4,1439
|
12
|
+
source_google_search_console/schemas/search_analytics_page_report.json,sha256=-b0Y0LenTchS0q9A2aQ4hIjUjXkYF8erOtyrTMhf6MM,1776
|
13
|
+
source_google_search_console/schemas/search_analytics_site_report_by_page.json,sha256=hWKHkm1reqGGu1dNcWBe6_XkZ5tK-UaiymrYRVgxRxI,1515
|
14
|
+
source_google_search_console/schemas/search_analytics_site_report_by_site.json,sha256=rAh6LuNy7nCrrNM9MTd0qxAVc886ecQaqWRgV63OfyA,1408
|
15
|
+
source_google_search_console/service_account_authenticator.py,sha256=pAWKAXfwfTY3xkXvQJH0EyFphFULdCIcC47YXYTO9X8,1307
|
16
|
+
source_google_search_console/source.py,sha256=ddqYq3ZSNrVtGvuQQ5WnHgMLuf92AtumzdDKWGffwRo,8721
|
17
|
+
source_google_search_console/spec.json,sha256=SensIrWvoie2aGwxmgoMYpq2jb3XP3F2myQWCVQ4db8,8980
|
18
|
+
source_google_search_console/streams.py,sha256=yb78hGaKPDCJoFqPSun3lDhr8VhSxcLgXTLtX2ouVpY,15804
|
19
|
+
airbyte_source_google_search_console-1.7.0.dist-info/METADATA,sha256=R-pJQZUfWv2duwzSFWta7vbn8V01TeESsaoRO5728mo,5621
|
20
|
+
airbyte_source_google_search_console-1.7.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
21
|
+
airbyte_source_google_search_console-1.7.0.dist-info/entry_points.txt,sha256=DMcgc9bCX-Vt6hm_68pa77qS3eGdeMhg-UdlFc-XKUM,85
|
22
|
+
airbyte_source_google_search_console-1.7.0.dist-info/RECORD,,
|
@@ -0,0 +1,81 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2025 Airbyte, Inc., all rights reserved.
|
3
|
+
#
|
4
|
+
|
5
|
+
from dataclasses import dataclass
|
6
|
+
from typing import Any, Mapping, Optional
|
7
|
+
|
8
|
+
from airbyte_cdk.sources.declarative.migrations.state_migration import StateMigration
|
9
|
+
|
10
|
+
|
11
|
+
@dataclass
|
12
|
+
class NestedSubstreamStateMigration(StateMigration):
|
13
|
+
"""
|
14
|
+
We require a custom state migration because SearchAnalytics streams contain two nested levels of
|
15
|
+
substreams. The existing LegacyToPerPartitionStateMigration only handles one level.
|
16
|
+
|
17
|
+
Legacy state format is as follows:
|
18
|
+
{
|
19
|
+
"date": "2025-05-28",
|
20
|
+
"https://www.example.com/": {
|
21
|
+
"web": {
|
22
|
+
"date": "2025-05-25"
|
23
|
+
},
|
24
|
+
"news": {
|
25
|
+
"date": "2023-05-22"
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
The resulting migrated per-partition state is:
|
31
|
+
{
|
32
|
+
"use_global_cursor": false,
|
33
|
+
"states": [
|
34
|
+
{
|
35
|
+
"partition": {
|
36
|
+
"search_type": "web",
|
37
|
+
"site_url": "https://www.example.com/"
|
38
|
+
},
|
39
|
+
"cursor": {
|
40
|
+
"date": "2025-05-25"
|
41
|
+
}
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"partition": {
|
45
|
+
"search_type": "news",
|
46
|
+
"site_url": "https://www.example.com/"
|
47
|
+
},
|
48
|
+
"cursor": {
|
49
|
+
"date": "2023-05-22"
|
50
|
+
}
|
51
|
+
}],
|
52
|
+
"state": {
|
53
|
+
"date": "2025-05-25"
|
54
|
+
}
|
55
|
+
}
|
56
|
+
"""
|
57
|
+
|
58
|
+
def should_migrate(self, stream_state: Mapping[str, Any]) -> bool:
|
59
|
+
return len(stream_state) > 0 and "states" not in stream_state
|
60
|
+
|
61
|
+
def migrate(self, stream_state: Mapping[str, Any]) -> Mapping[str, Any]:
|
62
|
+
global_state: Optional[Mapping[str, Any]] = None
|
63
|
+
per_partition_state = []
|
64
|
+
for site_url_key, search_type_state in stream_state.items():
|
65
|
+
if site_url_key == "date":
|
66
|
+
# The legacy state also contains a global cursor value under the `date` key which equates
|
67
|
+
# to global state.
|
68
|
+
#
|
69
|
+
# However, the Python implementation does not appear to be implemented
|
70
|
+
# correctly and simply saves the state of the last seen partition. Since I don't trust the
|
71
|
+
# legacy value and in the current implementation global state is applied to partitions
|
72
|
+
# without an existing value, I'm making a conscious choice to not migrate the global value.
|
73
|
+
continue
|
74
|
+
else:
|
75
|
+
site_url = site_url_key
|
76
|
+
for search_type_key, cursor in search_type_state.items():
|
77
|
+
per_partition_state.append({"partition": {"site_url": site_url, "search_type": search_type_key}, "cursor": cursor})
|
78
|
+
return {
|
79
|
+
"use_global_cursor": False,
|
80
|
+
"states": per_partition_state,
|
81
|
+
}
|
@@ -6,8 +6,11 @@
|
|
6
6
|
import logging
|
7
7
|
from typing import Any, List, Mapping
|
8
8
|
|
9
|
+
import orjson
|
10
|
+
|
9
11
|
from airbyte_cdk.config_observation import create_connector_config_control_message
|
10
12
|
from airbyte_cdk.entrypoint import AirbyteEntrypoint
|
13
|
+
from airbyte_cdk.models import AirbyteMessageSerializer
|
11
14
|
from airbyte_cdk.sources import Source
|
12
15
|
from airbyte_cdk.sources.message import InMemoryMessageRepository, MessageRepository
|
13
16
|
|
@@ -77,7 +80,7 @@ class MigrateCustomReports:
|
|
77
80
|
cls.message_repository.emit_message(create_connector_config_control_message(migrated_config))
|
78
81
|
# emit the Airbyte Control Message from message queue to stdout
|
79
82
|
for message in cls.message_repository._message_queue:
|
80
|
-
print(message.
|
83
|
+
print(orjson.dumps(AirbyteMessageSerializer.dump(message)).decode())
|
81
84
|
|
82
85
|
@classmethod
|
83
86
|
def migrate(cls, args: List[str], source: Source) -> None:
|