airbyte-source-shopify 2.5.18__py3-none-any.whl → 2.6.1__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.
@@ -1,8 +1,7 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: airbyte-source-shopify
3
- Version: 2.5.18
3
+ Version: 2.6.1
4
4
  Summary: Source CDK implementation for Shopify.
5
- Home-page: https://airbyte.com
6
5
  License: ELv2
7
6
  Author: Airbyte
8
7
  Author-email: contact@airbyte.io
@@ -15,6 +14,7 @@ Requires-Dist: airbyte-cdk (>=6,<7)
15
14
  Requires-Dist: graphql-query (>=1,<2)
16
15
  Requires-Dist: sgqlc (==16.3)
17
16
  Project-URL: Documentation, https://docs.airbyte.com/integrations/sources/shopify
17
+ Project-URL: Homepage, https://airbyte.com
18
18
  Project-URL: Repository, https://github.com/airbytehq/airbyte
19
19
  Description-Content-Type: text/markdown
20
20
 
@@ -13,7 +13,6 @@ source_shopify/schemas/countries.json,sha256=HrDHbtuc1WHyAzKVMqllTzcYdDmPQ2kwnEw
13
13
  source_shopify/schemas/custom_collections.json,sha256=ElDY1y_G_VFPOGr9ipU022AZDWKB2LC8n8Cb6FGF8UM,3100
14
14
  source_shopify/schemas/customer_address.json,sha256=kLKylul_xK7eO_aduvDddj078k8aQLM4JtUEpa5Tp_8,2628
15
15
  source_shopify/schemas/customer_journey_summary.json,sha256=GlZmIqFeR1x84DwgwMo28HQ8QseImkhvYxLSNRkUmwg,12733
16
- source_shopify/schemas/customer_saved_search.json,sha256=VKk7gFVdempXguprL3n5krTIpleMEPzarY7U7qfiGvw,986
17
16
  source_shopify/schemas/customers.json,sha256=pywejBEtvMnRHvvnJQhfA8NlCBjELv7XuMlKdpS4cZI,10233
18
17
  source_shopify/schemas/discount_codes.json,sha256=YxGptdpjXwM46fmzs5zoi3m96xAWKXrfllC_oIZW0vo,3730
19
18
  source_shopify/schemas/disputes.json,sha256=Uvzy1Gi954cLxij6H0Vbz0OWS6GS10YaJI4DJfY2x8I,1775
@@ -45,12 +44,11 @@ source_shopify/schemas/price_rules.json,sha256=aZ-Re9Oc9g0ci8SPn0_ufvKPsGDBcTaXH
45
44
  source_shopify/schemas/product_images.json,sha256=0l3ACfOfnXz8N8oMHwvvfZUFKeeuZ2DlRRu5-FxUhaI,1760
46
45
  source_shopify/schemas/product_variants.json,sha256=gEX-ZjfE95zJndX6MfmImCg499vYh97t7OWD5EQPHF0,8267
47
46
  source_shopify/schemas/products.json,sha256=n7m1ndEnAM7Pee5ca0JZWCl5Y0VffGmTZjqjHhiht1I,22609
48
- source_shopify/schemas/products_graph_ql.json,sha256=4zdUEMsaZsWDQDf2mDVEOe7LnHEyG0LhCtrEPDXUk1s,3598
49
47
  source_shopify/schemas/shop.json,sha256=vEGiTvEYX7qnMq06MRVBycqih49h49xjTNC6gJuxTWs,8137
50
48
  source_shopify/schemas/smart_collections.json,sha256=kv7dINsvgzJ0RyKfFNKjU0apdNDXwQaHfnNZfQsshcU,2009
51
49
  source_shopify/schemas/tender_transactions.json,sha256=U8fdT-eflycEPzYSpBDiB0lp9wxmJHgioHTrICflh78,2006
52
50
  source_shopify/schemas/transactions.json,sha256=vbwscH3UcAtbSsC70mBka4oNaFR4S3S6IFBmzR7t37U,10226
53
- source_shopify/scopes.py,sha256=PfqovbAvu_HZPim2kWQQUe-2rZ80Aq5yHPfNbHP87gA,6534
51
+ source_shopify/scopes.py,sha256=UVDERXNismYSnRaXwUXcn8x7Z6EtoNKOHts0Vs_Kl2I,6443
54
52
  source_shopify/shopify_graphql/bulk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
53
  source_shopify/shopify_graphql/bulk/exceptions.py,sha256=4dj7Za4xIfwL-zf8joT9svF_RSoGlE3GviMiIl1e1rs,2532
56
54
  source_shopify/shopify_graphql/bulk/job.py,sha256=_GL2WXK23yJjYcnOzuiBgpBxvng3RF_ezPhl265puz4,27635
@@ -59,15 +57,13 @@ source_shopify/shopify_graphql/bulk/record.py,sha256=X6VGngugv7a_S8UEeDo121BkdCV
59
57
  source_shopify/shopify_graphql/bulk/retry.py,sha256=R5rSJJE8D5zcj6mN-OmmNO2aFZEIdjAlWclDDVW5KPI,2626
60
58
  source_shopify/shopify_graphql/bulk/status.py,sha256=RmuQ2XsYL3iRCpVGxea9F1wXGmbwasDCSXjaTyL4LMA,328
61
59
  source_shopify/shopify_graphql/bulk/tools.py,sha256=nUQ2ZmPTKJNJdfLToR6KJtLKcJFCChSifkAOvwg0Vss,4065
62
- source_shopify/shopify_graphql/graphql.py,sha256=aJccSbPQKrmhq61KHUfYG94GzRsaPUwHaLZiNcFxjf0,1970
63
- source_shopify/shopify_graphql/schema.py,sha256=ICPxr0MWsmAUZjOWCx_zRbSNourHznKNDcWX5y_x-RM,1354904
64
- source_shopify/source.py,sha256=_anfEQKazPlSV9yOqlOXhSVQfuoc1wL-w4HOYm2nFso,8569
60
+ source_shopify/source.py,sha256=WmtSMHMop9NvREj0VUR6P8qWYWyv21y6rFk42bPBzAo,8445
65
61
  source_shopify/spec.json,sha256=ITYWiQ-NrI5VISk5qmUQhp9ChUE2FV18d8xzVzPwvAg,6144
66
62
  source_shopify/streams/base_streams.py,sha256=-Yww6tSot5xG4MSwSK2JWHjR3DDFYM9q5Lw3GAKDNsc,40491
67
- source_shopify/streams/streams.py,sha256=AhB73104HJNLWDTSgLdCJWcEoqsO3KxnBccOzeGNUmI,12056
63
+ source_shopify/streams/streams.py,sha256=UoWe89U5xfM2jdgCpWqRv5S4tXGM7GTMU0gq8nCr9oU,9618
68
64
  source_shopify/transform.py,sha256=mn0htL812_90zc_YszGQa0hHcIZQpYYdmk8IqpZm5TI,4685
69
65
  source_shopify/utils.py,sha256=GOIIL_UVHfgkrfI5CbDkSQi92qdgcbcGEFyZQ_A78KE,14463
70
- airbyte_source_shopify-2.5.18.dist-info/METADATA,sha256=D6ZxVY8OFtQX01ov6I6CgngUPJItOuf--tz3QO0ogBI,5257
71
- airbyte_source_shopify-2.5.18.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
72
- airbyte_source_shopify-2.5.18.dist-info/entry_points.txt,sha256=SyTwKSsPk9MCdPf01saWpnp8hcmZOgBssVcSIvMbBeQ,57
73
- airbyte_source_shopify-2.5.18.dist-info/RECORD,,
66
+ airbyte_source_shopify-2.6.1.dist-info/METADATA,sha256=GTU4ejrYteeQnSTGydYu86uaUBnHP5e09J9Gh39s07s,5268
67
+ airbyte_source_shopify-2.6.1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
68
+ airbyte_source_shopify-2.6.1.dist-info/entry_points.txt,sha256=SyTwKSsPk9MCdPf01saWpnp8hcmZOgBssVcSIvMbBeQ,57
69
+ airbyte_source_shopify-2.6.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.0.0
2
+ Generator: poetry-core 2.0.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
source_shopify/scopes.py CHANGED
@@ -19,7 +19,6 @@ SCOPES_MAPPING: Mapping[str, set[str]] = {
19
19
  # SCOPE: read_customers
20
20
  "Customers": ("read_customers",),
21
21
  "MetafieldCustomers": ("read_customers",),
22
- "CustomerSavedSearch": ("read_customers",),
23
22
  "CustomerAddress": ("read_customers",),
24
23
  # SCOPE: read_orders
25
24
  "OrderAgreements": ("read_orders",),
@@ -38,7 +37,6 @@ SCOPES_MAPPING: Mapping[str, set[str]] = {
38
37
  "MetafieldDraftOrders": ("read_draft_orders",),
39
38
  # SCOPE: read_products
40
39
  "Products": ("read_products",),
41
- "ProductsGraphQl": ("read_products",),
42
40
  "MetafieldProducts": ("read_products",),
43
41
  "ProductImages": ("read_products",),
44
42
  "MetafieldProductImages": ("read_products",),
source_shopify/source.py CHANGED
@@ -27,7 +27,6 @@ from .streams.streams import (
27
27
  CustomerAddress,
28
28
  CustomerJourneySummary,
29
29
  Customers,
30
- CustomerSavedSearch,
31
30
  DiscountCodes,
32
31
  Disputes,
33
32
  DraftOrders,
@@ -57,7 +56,6 @@ from .streams.streams import (
57
56
  PriceRules,
58
57
  ProductImages,
59
58
  Products,
60
- ProductsGraphQl,
61
59
  ProductVariants,
62
60
  Shop,
63
61
  SmartCollections,
@@ -212,13 +210,11 @@ class SourceShopify(AbstractSource):
212
210
  PriceRules(config),
213
211
  ProductImages(config),
214
212
  Products(config),
215
- ProductsGraphQl(config),
216
213
  ProductVariants(config),
217
214
  Shop(config),
218
215
  SmartCollections(config),
219
216
  TenderTransactions(config),
220
217
  self.select_transactions_stream(config),
221
- CustomerSavedSearch(config),
222
218
  CustomerAddress(config),
223
219
  Countries(config),
224
220
  ]
@@ -3,10 +3,8 @@
3
3
  #
4
4
 
5
5
 
6
- from typing import Any, Iterable, Mapping, MutableMapping, Optional
6
+ from typing import Any, Mapping, MutableMapping
7
7
 
8
- import requests
9
- from requests.exceptions import RequestException
10
8
  from source_shopify.shopify_graphql.bulk.query import (
11
9
  Collection,
12
10
  CustomerAddresses,
@@ -30,9 +28,6 @@ from source_shopify.shopify_graphql.bulk.query import (
30
28
  ProductVariant,
31
29
  Transaction,
32
30
  )
33
- from source_shopify.shopify_graphql.graphql import get_query_products
34
- from source_shopify.utils import ApiTypeEnum
35
- from source_shopify.utils import ShopifyRateLimiter as limiter
36
31
 
37
32
  from airbyte_cdk.sources.streams.core import package_name_from_class
38
33
  from airbyte_cdk.sources.utils.schema_helpers import ResourceSchemaLoader
@@ -120,57 +115,6 @@ class Products(IncrementalShopifyGraphQlBulkStream):
120
115
  bulk_query: Product = Product
121
116
 
122
117
 
123
- class ProductsGraphQl(IncrementalShopifyStream):
124
- filter_field = "updatedAt"
125
- cursor_field = "updatedAt"
126
- data_field = "graphql"
127
- http_method = "POST"
128
- # pin the old api_version before this stream is deprecated
129
- api_version = "2023-07"
130
-
131
- def request_params(
132
- self,
133
- stream_state: Optional[Mapping[str, Any]] = None,
134
- next_page_token: Optional[Mapping[str, Any]] = None,
135
- **kwargs,
136
- ) -> MutableMapping[str, Any]:
137
- return {}
138
-
139
- def request_body_json(
140
- self,
141
- stream_state: Mapping[str, Any],
142
- stream_slice: Optional[Mapping[str, Any]] = None,
143
- next_page_token: Optional[Mapping[str, Any]] = None,
144
- ) -> Optional[Mapping]:
145
- state_value = stream_state.get(self.filter_field)
146
- if state_value:
147
- filter_value = state_value
148
- else:
149
- filter_value = self.default_filter_field_value
150
- query = get_query_products(
151
- first=self.limit, filter_field=self.filter_field, filter_value=filter_value, next_page_token=next_page_token
152
- )
153
- return {"query": query}
154
-
155
- @staticmethod
156
- def next_page_token(response: requests.Response) -> Optional[Mapping[str, Any]]:
157
- page_info = response.json()["data"]["products"]["pageInfo"]
158
- has_next_page = page_info["hasNextPage"]
159
- if has_next_page:
160
- return page_info["endCursor"]
161
- else:
162
- return None
163
-
164
- @limiter.balance_rate_limit(api_type=ApiTypeEnum.graphql.value)
165
- def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapping]:
166
- if response.status_code is requests.codes.OK:
167
- try:
168
- json_response = response.json()["data"]["products"]["nodes"]
169
- yield from self.produce_records(json_response)
170
- except RequestException as e:
171
- self.logger.warning(f"Unexpected error in `parse_ersponse`: {e}, the actual response data: {response.text}")
172
-
173
-
174
118
  class MetafieldProducts(IncrementalShopifyGraphQlBulkStream):
175
119
  parent_stream_class = Products
176
120
  bulk_query: MetafieldProduct = MetafieldProduct
@@ -377,14 +321,6 @@ class MetafieldShops(IncrementalShopifyStream):
377
321
  data_field = "metafields"
378
322
 
379
323
 
380
- class CustomerSavedSearch(IncrementalShopifyStream):
381
- api_version = "2022-01"
382
- cursor_field = "id"
383
- order_field = "id"
384
- data_field = "customer_saved_searches"
385
- filter_field = "since_id"
386
-
387
-
388
324
  class CustomerAddress(IncrementalShopifyGraphQlBulkStream):
389
325
  parent_stream_class = Customers
390
326
  bulk_query: CustomerAddresses = CustomerAddresses
@@ -1,32 +0,0 @@
1
- {
2
- "type": ["null", "object"],
3
- "additionalProperties": true,
4
- "properties": {
5
- "created_at": {
6
- "description": "The date and time when the customer saved search was created.",
7
- "type": ["null", "string"],
8
- "format": "date-time"
9
- },
10
- "id": {
11
- "description": "The unique identifier for the customer saved search.",
12
- "type": ["null", "integer"]
13
- },
14
- "name": {
15
- "description": "The name given to the customer saved search.",
16
- "type": ["null", "string"]
17
- },
18
- "query": {
19
- "description": "The search query string or parameters used for this saved search.",
20
- "type": ["null", "string"]
21
- },
22
- "shop_url": {
23
- "description": "The URL of the shop associated with this customer saved search.",
24
- "type": ["null", "string"]
25
- },
26
- "updated_at": {
27
- "description": "The date and time when the customer saved search was last updated.",
28
- "type": ["null", "string"],
29
- "format": "date-time"
30
- }
31
- }
32
- }
@@ -1,123 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema#",
3
- "properties": {
4
- "createdAt": {
5
- "description": "The date and time when the product was created.",
6
- "type": "string"
7
- },
8
- "description": {
9
- "description": "The product's description.",
10
- "type": "string"
11
- },
12
- "descriptionHtml": {
13
- "description": "The product's description in HTML format.",
14
- "type": "string"
15
- },
16
- "handle": {
17
- "description": "The unique URL-friendly handle of the product.",
18
- "type": "string"
19
- },
20
- "id": {
21
- "description": "The unique identifier of the product.",
22
- "type": "string"
23
- },
24
- "isGiftCard": {
25
- "description": "Indicates whether the product is a gift card.",
26
- "type": "boolean"
27
- },
28
- "legacyResourceId": {
29
- "description": "The legacy resource ID of the product.",
30
- "type": "string"
31
- },
32
- "mediaCount": {
33
- "description": "The total count of media (images/videos) associated with the product.",
34
- "type": "integer"
35
- },
36
- "onlineStorePreviewUrl": {
37
- "description": "The URL for previewing the product on the online store.",
38
- "type": "string"
39
- },
40
- "onlineStoreUrl": {
41
- "description": "The URL of the product on the online store.",
42
- "type": ["null", "string"]
43
- },
44
- "options": {
45
- "description": "Represents various options available for the product",
46
- "items": {
47
- "properties": {
48
- "id": {
49
- "description": "The unique identifier of the option.",
50
- "type": "string"
51
- },
52
- "name": {
53
- "description": "The name of the option.",
54
- "type": "string"
55
- },
56
- "position": {
57
- "description": "The position of the option.",
58
- "type": "integer"
59
- },
60
- "values": {
61
- "description": "Contains the different values for the options",
62
- "items": {
63
- "description": "The possible values for the option.",
64
- "type": "string"
65
- },
66
- "type": "array"
67
- }
68
- },
69
- "type": "object"
70
- },
71
- "type": "array"
72
- },
73
- "productType": {
74
- "description": "The type or category of the product.",
75
- "type": "string"
76
- },
77
- "publishedAt": {
78
- "description": "The date and time when the product was published.",
79
- "type": ["null", "string"]
80
- },
81
- "shop_url": {
82
- "description": "The URL of the shop where the product is listed.",
83
- "type": "string"
84
- },
85
- "status": {
86
- "description": "The status of the product.",
87
- "type": "string"
88
- },
89
- "tags": {
90
- "description": "Contains tags associated with the product",
91
- "items": {
92
- "description": "The tags associated with the product.",
93
- "type": "string"
94
- },
95
- "type": "array"
96
- },
97
- "title": {
98
- "description": "The title or name of the product.",
99
- "type": "string"
100
- },
101
- "totalInventory": {
102
- "description": "The total inventory count of the product.",
103
- "type": "integer"
104
- },
105
- "totalVariants": {
106
- "description": "The total number of variants available for the product.",
107
- "type": "integer"
108
- },
109
- "tracksInventory": {
110
- "description": "Indicates whether inventory tracking is enabled for the product.",
111
- "type": "boolean"
112
- },
113
- "updatedAt": {
114
- "description": "The date and time when the product was last updated.",
115
- "type": "string"
116
- },
117
- "vendor": {
118
- "description": "The vendor or manufacturer of the product.",
119
- "type": "string"
120
- }
121
- },
122
- "type": "object"
123
- }
@@ -1,65 +0,0 @@
1
- #
2
- # Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3
- #
4
-
5
-
6
- from typing import Optional
7
-
8
- import sgqlc.operation
9
-
10
- from . import schema
11
-
12
-
13
- _schema = schema
14
- _schema_root = _schema.shopify_schema
15
-
16
-
17
- # the graphql api requires the query filter to be snake case even though the column returned is camel case
18
- def _camel_to_snake(camel_case: str):
19
- snake_case = []
20
- for char in camel_case:
21
- if char.isupper():
22
- snake_case.append("_" + char.lower())
23
- else:
24
- snake_case.append(char)
25
- return "".join(snake_case).lstrip("_")
26
-
27
-
28
- def get_query_products(first: int, filter_field: str, filter_value: str, next_page_token: Optional[str]):
29
- op = sgqlc.operation.Operation(_schema_root.query_type)
30
- snake_case_filter_field = _camel_to_snake(filter_field)
31
- products_args = {
32
- "first": first,
33
- "query": f"{snake_case_filter_field}:>'{filter_value}'" if filter_value else None,
34
- "after": next_page_token,
35
- }
36
- products = op.products(**products_args)
37
- products.nodes.id()
38
- products.nodes.title()
39
- products.nodes.updated_at()
40
- products.nodes.created_at()
41
- products.nodes.published_at()
42
- products.nodes.status()
43
- products.nodes.vendor()
44
- products.nodes.product_type()
45
- products.nodes.tags()
46
- products.nodes.options()
47
- products.nodes.options().id()
48
- products.nodes.options().name()
49
- products.nodes.options().position()
50
- products.nodes.options().values()
51
- products.nodes.handle()
52
- products.nodes.description()
53
- products.nodes.tracks_inventory()
54
- products.nodes.total_inventory()
55
- products.nodes.total_variants()
56
- products.nodes.online_store_url()
57
- products.nodes.online_store_preview_url()
58
- products.nodes.description_html()
59
- products.nodes.is_gift_card()
60
- products.nodes.legacy_resource_id()
61
- products.nodes.media_count()
62
- products.page_info()
63
- products.page_info.has_next_page()
64
- products.page_info.end_cursor()
65
- return str(op)