airbyte-source-iterable 0.5.10__tar.gz → 0.6.0__tar.gz
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_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/PKG-INFO +2 -3
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/pyproject.toml +4 -5
- airbyte_source_iterable-0.6.0/source_iterable/components.py +22 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/manifest.yaml +22 -12
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/streams.py +2 -2
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/utils.py +0 -2
- airbyte_source_iterable-0.5.10/source_iterable/components.py +0 -41
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/README.md +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/__init__.py +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/run.py +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/campaigns.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/campaigns_metrics.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/channels.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/email_bounce.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/email_click.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/email_complaint.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/email_open.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/email_send.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/email_send_skip.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/email_subscribe.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/email_unsubscribe.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/events.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/list_users.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/lists.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/message_types.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/metadata.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/templates.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/users.json +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/slice_generators.py +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/source.py +0 -0
- {airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/spec.json +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: airbyte-source-iterable
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.6.0
|
4
4
|
Summary: Source implementation for Iterable.
|
5
5
|
Home-page: https://airbyte.com
|
6
6
|
License: MIT
|
@@ -12,10 +12,9 @@ Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.9
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
15
|
-
Requires-Dist: airbyte-cdk (
|
15
|
+
Requires-Dist: airbyte-cdk (>=3,<4)
|
16
16
|
Requires-Dist: pendulum (==2.1.2)
|
17
17
|
Requires-Dist: python-dateutil (==2.8.2)
|
18
|
-
Requires-Dist: requests (==2.31.0)
|
19
18
|
Project-URL: Documentation, https://docs.airbyte.com/integrations/sources/iterable
|
20
19
|
Project-URL: Repository, https://github.com/airbytehq/airbyte
|
21
20
|
Description-Content-Type: text/markdown
|
@@ -5,7 +5,7 @@ requires = [
|
|
5
5
|
build-backend = "poetry.core.masonry.api"
|
6
6
|
|
7
7
|
[tool.poetry]
|
8
|
-
version = "0.
|
8
|
+
version = "0.6.0"
|
9
9
|
name = "airbyte-source-iterable"
|
10
10
|
description = "Source implementation for Iterable."
|
11
11
|
authors = [
|
@@ -23,16 +23,15 @@ packages = [
|
|
23
23
|
[tool.poetry.dependencies]
|
24
24
|
python = "^3.9,<3.12"
|
25
25
|
pendulum = "==2.1.2"
|
26
|
-
airbyte-cdk = "
|
27
|
-
requests = "==2.31.0"
|
26
|
+
airbyte-cdk = "^3"
|
28
27
|
python-dateutil = "==2.8.2"
|
29
28
|
|
30
29
|
[tool.poetry.scripts]
|
31
30
|
source-iterable = "source_iterable.run:run"
|
32
31
|
|
33
32
|
[tool.poetry.group.dev.dependencies]
|
34
|
-
pytest = "^6.
|
33
|
+
pytest = "^6.2"
|
35
34
|
pytest-mock = "^3.6.1"
|
36
|
-
freezegun = "==1.1
|
35
|
+
freezegun = "==1.5.1"
|
37
36
|
requests-mock = "^1.9.3"
|
38
37
|
responses = "==0.23.1"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
|
3
|
+
#
|
4
|
+
|
5
|
+
from dataclasses import dataclass
|
6
|
+
from typing import Any, Iterable, Mapping
|
7
|
+
|
8
|
+
import requests
|
9
|
+
from airbyte_cdk.sources.declarative.extractors.dpath_extractor import DpathExtractor
|
10
|
+
|
11
|
+
|
12
|
+
@dataclass
|
13
|
+
class EventsRecordExtractor(DpathExtractor):
|
14
|
+
common_fields = ("itblInternal", "_type", "createdAt", "email")
|
15
|
+
|
16
|
+
def extract_records(self, response: requests.Response) -> Iterable[Mapping[str, Any]]:
|
17
|
+
jsonl_records = super().extract_records(response=response)
|
18
|
+
for record_dict in jsonl_records:
|
19
|
+
record_dict_common_fields = {}
|
20
|
+
for field in self.common_fields:
|
21
|
+
record_dict_common_fields[field] = record_dict.pop(field, None)
|
22
|
+
yield {**record_dict_common_fields, "data": record_dict}
|
{airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/manifest.yaml
RENAMED
@@ -67,6 +67,8 @@ streams:
|
|
67
67
|
type: DeclarativeStream
|
68
68
|
retriever:
|
69
69
|
type: SimpleRetriever
|
70
|
+
decoder:
|
71
|
+
type: IterableDecoder
|
70
72
|
paginator:
|
71
73
|
type: NoPagination
|
72
74
|
requester:
|
@@ -87,9 +89,8 @@ streams:
|
|
87
89
|
record_selector:
|
88
90
|
type: RecordSelector
|
89
91
|
extractor:
|
90
|
-
|
91
|
-
field_path:
|
92
|
-
- getUsers
|
92
|
+
type: DpathExtractor
|
93
|
+
field_path: []
|
93
94
|
partition_router:
|
94
95
|
- type: SubstreamPartitionRouter
|
95
96
|
parent_stream_configs:
|
@@ -139,6 +140,12 @@ streams:
|
|
139
140
|
- path:
|
140
141
|
- listId
|
141
142
|
value: "{{ stream_slice.list_id }}"
|
143
|
+
- path:
|
144
|
+
- email
|
145
|
+
value: "{{ record.record }}"
|
146
|
+
- type: RemoveFields
|
147
|
+
field_pointers:
|
148
|
+
- - record
|
142
149
|
- name: campaigns
|
143
150
|
type: DeclarativeStream
|
144
151
|
retriever:
|
@@ -262,6 +269,8 @@ streams:
|
|
262
269
|
type: DeclarativeStream
|
263
270
|
retriever:
|
264
271
|
type: SimpleRetriever
|
272
|
+
decoder:
|
273
|
+
type: JsonlDecoder
|
265
274
|
paginator:
|
266
275
|
type: NoPagination
|
267
276
|
requester:
|
@@ -284,9 +293,8 @@ streams:
|
|
284
293
|
record_selector:
|
285
294
|
type: RecordSelector
|
286
295
|
extractor:
|
287
|
-
|
288
|
-
field_path:
|
289
|
-
- users
|
296
|
+
type: DpathExtractor
|
297
|
+
field_path: []
|
290
298
|
partition_router: []
|
291
299
|
primary_key: []
|
292
300
|
incremental_sync:
|
@@ -318,6 +326,8 @@ streams:
|
|
318
326
|
primary_key: []
|
319
327
|
retriever:
|
320
328
|
type: SimpleRetriever
|
329
|
+
decoder:
|
330
|
+
type: JsonlDecoder
|
321
331
|
requester:
|
322
332
|
type: HttpRequester
|
323
333
|
url_base: https://api.iterable.com/api/
|
@@ -338,15 +348,14 @@ streams:
|
|
338
348
|
type: RecordSelector
|
339
349
|
extractor:
|
340
350
|
class_name: source_iterable.components.EventsRecordExtractor
|
341
|
-
field_path:
|
342
|
-
- events
|
351
|
+
field_path: []
|
343
352
|
paginator:
|
344
353
|
type: NoPagination
|
345
354
|
partition_router:
|
346
355
|
- type: SubstreamPartitionRouter
|
347
356
|
parent_stream_configs:
|
348
357
|
- type: ParentStreamConfig
|
349
|
-
parent_key:
|
358
|
+
parent_key: record
|
350
359
|
request_option:
|
351
360
|
inject_into: request_parameter
|
352
361
|
type: RequestOption
|
@@ -357,6 +366,8 @@ streams:
|
|
357
366
|
type: DeclarativeStream
|
358
367
|
retriever:
|
359
368
|
type: SimpleRetriever
|
369
|
+
decoder:
|
370
|
+
type: IterableDecoder
|
360
371
|
paginator:
|
361
372
|
type: NoPagination
|
362
373
|
requester:
|
@@ -377,9 +388,8 @@ streams:
|
|
377
388
|
record_selector:
|
378
389
|
type: RecordSelector
|
379
390
|
extractor:
|
380
|
-
|
381
|
-
field_path:
|
382
|
-
- getUsers
|
391
|
+
type: DpathExtractor
|
392
|
+
field_path: []
|
383
393
|
partition_router:
|
384
394
|
- type: SubstreamPartitionRouter
|
385
395
|
parent_stream_configs:
|
@@ -17,7 +17,7 @@ from airbyte_cdk.sources.streams.http import HttpStream
|
|
17
17
|
from airbyte_cdk.sources.streams.http.exceptions import DefaultBackoffException, UserDefinedBackoffException
|
18
18
|
from airbyte_cdk.sources.utils.schema_helpers import ResourceSchemaLoader
|
19
19
|
from pendulum.datetime import DateTime
|
20
|
-
from requests import HTTPError
|
20
|
+
from requests import HTTPError
|
21
21
|
from requests.exceptions import ChunkedEncodingError
|
22
22
|
from source_iterable.slice_generators import AdjustableSliceGenerator, RangeSliceGenerator, StreamSlice
|
23
23
|
from source_iterable.utils import dateutil_parse
|
@@ -106,7 +106,7 @@ class IterableStream(HttpStream, ABC):
|
|
106
106
|
if self._slice_retry < 3:
|
107
107
|
return True
|
108
108
|
return False
|
109
|
-
return
|
109
|
+
return response.status_code == 429 or 500 <= response.status_code < 600
|
110
110
|
|
111
111
|
def read_records(
|
112
112
|
self,
|
@@ -1,41 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
|
3
|
-
#
|
4
|
-
|
5
|
-
import json
|
6
|
-
from dataclasses import dataclass
|
7
|
-
from io import StringIO
|
8
|
-
|
9
|
-
import requests
|
10
|
-
from airbyte_cdk.sources.declarative.extractors.dpath_extractor import DpathExtractor
|
11
|
-
from airbyte_cdk.sources.declarative.types import Config, Record, StreamSlice, StreamState
|
12
|
-
|
13
|
-
|
14
|
-
@dataclass
|
15
|
-
class XJsonRecordExtractor(DpathExtractor):
|
16
|
-
def extract_records(self, response: requests.Response) -> list[Record]:
|
17
|
-
return [json.loads(record) for record in response.iter_lines()]
|
18
|
-
|
19
|
-
|
20
|
-
@dataclass
|
21
|
-
class ListUsersRecordExtractor(DpathExtractor):
|
22
|
-
def extract_records(self, response: requests.Response) -> list[Record]:
|
23
|
-
return [{"email": record.decode()} for record in response.iter_lines()]
|
24
|
-
|
25
|
-
|
26
|
-
@dataclass
|
27
|
-
class EventsRecordExtractor(DpathExtractor):
|
28
|
-
common_fields = ("itblInternal", "_type", "createdAt", "email")
|
29
|
-
|
30
|
-
def extract_records(self, response: requests.Response) -> list[Record]:
|
31
|
-
jsonl_records = StringIO(response.text)
|
32
|
-
records = []
|
33
|
-
for record in jsonl_records:
|
34
|
-
record_dict = json.loads(record)
|
35
|
-
record_dict_common_fields = {}
|
36
|
-
for field in self.common_fields:
|
37
|
-
record_dict_common_fields[field] = record_dict.pop(field, None)
|
38
|
-
|
39
|
-
records.append({**record_dict_common_fields, "data": record_dict})
|
40
|
-
|
41
|
-
return records
|
File without changes
|
{airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/events.json
RENAMED
File without changes
|
File without changes
|
{airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/lists.json
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/schemas/users.json
RENAMED
File without changes
|
{airbyte_source_iterable-0.5.10 → airbyte_source_iterable-0.6.0}/source_iterable/slice_generators.py
RENAMED
File without changes
|
File without changes
|
File without changes
|