fivetran-connector-sdk 0.8.19.1__tar.gz → 0.8.20.1__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.
Files changed (20) hide show
  1. fivetran_connector_sdk-0.8.20.1/PKG-INFO +56 -0
  2. fivetran_connector_sdk-0.8.20.1/README.md +38 -0
  3. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk/__init__.py +50 -19
  4. fivetran_connector_sdk-0.8.20.1/src/fivetran_connector_sdk.egg-info/PKG-INFO +56 -0
  5. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk.egg-info/SOURCES.txt +1 -0
  6. fivetran_connector_sdk-0.8.19.1/PKG-INFO +0 -17
  7. fivetran_connector_sdk-0.8.19.1/src/fivetran_connector_sdk.egg-info/PKG-INFO +0 -17
  8. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/pyproject.toml +0 -0
  9. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/setup.cfg +0 -0
  10. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk/protos/__init__.py +0 -0
  11. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk/protos/common_pb2.py +0 -0
  12. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk/protos/common_pb2.pyi +0 -0
  13. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk/protos/common_pb2_grpc.py +0 -0
  14. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk/protos/connector_sdk_pb2.py +0 -0
  15. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk/protos/connector_sdk_pb2.pyi +0 -0
  16. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk/protos/connector_sdk_pb2_grpc.py +0 -0
  17. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk.egg-info/dependency_links.txt +0 -0
  18. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk.egg-info/entry_points.txt +0 -0
  19. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk.egg-info/requires.txt +0 -0
  20. {fivetran_connector_sdk-0.8.19.1 → fivetran_connector_sdk-0.8.20.1}/src/fivetran_connector_sdk.egg-info/top_level.txt +0 -0
@@ -0,0 +1,56 @@
1
+ Metadata-Version: 2.1
2
+ Name: fivetran_connector_sdk
3
+ Version: 0.8.20.1
4
+ Summary: Build custom connectors on Fivetran platform
5
+ Author-email: Fivetran <developers@fivetran.com>
6
+ Project-URL: Homepage, https://fivetran.com/docs/connectors/connector-sdk
7
+ Project-URL: Github, https://github.com/fivetran/fivetran_connector_sdk
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: grpcio==1.60.1
14
+ Requires-Dist: grpcio-tools==1.60.1
15
+ Requires-Dist: requests==2.31.0
16
+ Requires-Dist: get_pypi_latest_version==0.0.12
17
+ Requires-Dist: pipreqs==0.5.0
18
+
19
+ # **fivetran-connector-sdk**
20
+ The *fivetran-connector-sdk* is a Python module that enables you to write custom data connectors and deploy them as an extension of [Fivetran](https://www.fivetran.com/). Fivetran automatically manages running the connectors on your scheduled frequency and manages the required compute resources.
21
+
22
+ The Connector SDK service is the best fit for the following use cases:
23
+ - Fivetran doesn't have a connector for your source and is unlikely to support it soon.
24
+ - You are using private APIs, custom applications, unsupported file formats, or those that require pre-processing.
25
+ - You have sensitive data that needs filtering or anonymizing before entering the destination.
26
+ - You don't want to introduce a 3rd party into your pipeline (e.g., to host a custom function).
27
+
28
+ To learn more, see our [Connector SDK documentation](https://fivetran.com/docs/connectors/connector-sdk)
29
+
30
+ ## **Install**
31
+
32
+ pip install fivetran-connector-sdk
33
+
34
+ ## **Requirements**
35
+ - Python ≥3.9 and ≤3.12
36
+ - Operating System:
37
+ - Windows 10 or later
38
+ - MacOS 13 (Ventura) or later
39
+
40
+ ## **Getting started**
41
+ See [Quickstart guide](https://fivetran.com/docs/connectors/connector-sdk/quickstart-guide) to get started.
42
+
43
+ ## **Usage**
44
+ Import required classes from fivetran_connector_sdk to begin writing your custom data connector
45
+
46
+ ```python
47
+ from fivetran_connector_sdk import Connector
48
+ from fivetran_connector_sdk import Logging as log
49
+ from fivetran_connector_sdk import Operations as op
50
+ ```
51
+ See our [Technical Reference](https://fivetran.com/docs/connectors/connector-sdk/technical-reference#update) and [Best Practices](https://fivetran.com/docs/connectors/connector-sdk/best-practices) documentation for more details.
52
+
53
+ You can also refer to our [existing examples](https://github.com/fivetran/fivetran_connector_sdk) to better understand Fivetran's Connector SDK and start creating custom data connectors.
54
+
55
+ ## **Maintenance**
56
+ This package is actively maintained by Fivetran Developers. Please reach out to our [Support team](https://support.fivetran.com/hc/en-us) for any inquiries.
@@ -0,0 +1,38 @@
1
+ # **fivetran-connector-sdk**
2
+ The *fivetran-connector-sdk* is a Python module that enables you to write custom data connectors and deploy them as an extension of [Fivetran](https://www.fivetran.com/). Fivetran automatically manages running the connectors on your scheduled frequency and manages the required compute resources.
3
+
4
+ The Connector SDK service is the best fit for the following use cases:
5
+ - Fivetran doesn't have a connector for your source and is unlikely to support it soon.
6
+ - You are using private APIs, custom applications, unsupported file formats, or those that require pre-processing.
7
+ - You have sensitive data that needs filtering or anonymizing before entering the destination.
8
+ - You don't want to introduce a 3rd party into your pipeline (e.g., to host a custom function).
9
+
10
+ To learn more, see our [Connector SDK documentation](https://fivetran.com/docs/connectors/connector-sdk)
11
+
12
+ ## **Install**
13
+
14
+ pip install fivetran-connector-sdk
15
+
16
+ ## **Requirements**
17
+ - Python ≥3.9 and ≤3.12
18
+ - Operating System:
19
+ - Windows 10 or later
20
+ - MacOS 13 (Ventura) or later
21
+
22
+ ## **Getting started**
23
+ See [Quickstart guide](https://fivetran.com/docs/connectors/connector-sdk/quickstart-guide) to get started.
24
+
25
+ ## **Usage**
26
+ Import required classes from fivetran_connector_sdk to begin writing your custom data connector
27
+
28
+ ```python
29
+ from fivetran_connector_sdk import Connector
30
+ from fivetran_connector_sdk import Logging as log
31
+ from fivetran_connector_sdk import Operations as op
32
+ ```
33
+ See our [Technical Reference](https://fivetran.com/docs/connectors/connector-sdk/technical-reference#update) and [Best Practices](https://fivetran.com/docs/connectors/connector-sdk/best-practices) documentation for more details.
34
+
35
+ You can also refer to our [existing examples](https://github.com/fivetran/fivetran_connector_sdk) to better understand Fivetran's Connector SDK and start creating custom data connectors.
36
+
37
+ ## **Maintenance**
38
+ This package is actively maintained by Fivetran Developers. Please reach out to our [Support team](https://support.fivetran.com/hc/en-us) for any inquiries.
@@ -23,7 +23,7 @@ from fivetran_connector_sdk.protos import common_pb2
23
23
  from fivetran_connector_sdk.protos import connector_sdk_pb2
24
24
  from fivetran_connector_sdk.protos import connector_sdk_pb2_grpc
25
25
 
26
- __version__ = "0.8.19.1"
26
+ __version__ = "0.8.20.1"
27
27
 
28
28
  MAC_OS = "mac"
29
29
  WIN_OS = "windows"
@@ -532,7 +532,7 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
532
532
  """
533
533
  if not deploy_key: print("SEVERE: The Fivetran API key is missing. Please provide a valid Fivetran API key to create the connector."); os._exit(1)
534
534
  if not connection: print("SEVERE: The connection name is missing. Please provide a valid connection name to create the connector."); os._exit(1)
535
- _check_dict(configuration)
535
+ _check_dict(configuration, True)
536
536
 
537
537
  secrets_list = []
538
538
  if configuration:
@@ -774,31 +774,48 @@ class Connector(connector_sdk_pb2_grpc.ConnectorServicer):
774
774
  Returns:
775
775
  tuple[str, str]: A tuple containing the group ID and group name.
776
776
  """
777
- resp = rq.get("https://api.fivetran.com/v1/groups",
778
- headers={"Authorization": f"Basic {deploy_key}"})
777
+ groups_url = "https://api.fivetran.com/v1/groups"
778
+
779
+ params = {"limit": 500}
780
+ headers = {"Authorization": f"Basic {deploy_key}"}
781
+ resp = rq.get(groups_url, headers=headers, params=params)
779
782
 
780
783
  if not resp.ok:
781
- print(f"SEVERE: Unable to fetch list of destination names, status code = {resp.status_code}")
784
+ print(
785
+ f"SEVERE: Unable to fetch list of destination names, status code = {resp.status_code}")
782
786
  os._exit(1)
783
787
 
784
- # TODO: Do we need to implement pagination?
785
- groups = resp.json()['data']['items']
788
+ data = resp.json().get("data", {})
789
+ groups = data.get("items")
790
+
786
791
  if not groups:
787
792
  print("SEVERE: No destinations defined in the account")
788
793
  os._exit(1)
789
794
 
790
- if len(groups) == 1:
791
- return groups[0]['id'], groups[0]['name']
792
- else:
793
- if not group:
794
- print("SEVERE: Destination name is required when there are multiple destinations in the account")
795
+ if not group:
796
+ if len(groups) == 1:
797
+ return groups[0]['id'], groups[0]['name']
798
+ else:
799
+ print(
800
+ "SEVERE: Destination name is required when there are multiple destinations in the account")
795
801
  os._exit(1)
796
-
797
- for grp in groups:
798
- if grp['name'] == group:
799
- return grp['id'], grp['name']
800
-
801
- print(f"SEVERE: Specified destination was not found in the account: {group}")
802
+ else:
803
+ while True:
804
+ for grp in groups:
805
+ if grp['name'] == group:
806
+ return grp['id'], grp['name']
807
+
808
+ next_cursor = data.get("next_cursor")
809
+ if not next_cursor:
810
+ break
811
+
812
+ params = {"cursor": next_cursor, "limit": 500}
813
+ resp = rq.get(groups_url, headers=headers, params=params)
814
+ data = resp.json().get("data", {})
815
+ groups = data.get("items", [])
816
+
817
+ print(
818
+ f"SEVERE: The specified destination '{group}' was not found in your account.")
802
819
  os._exit(1)
803
820
 
804
821
  # Call this method to run the connector in production
@@ -1179,7 +1196,7 @@ def main():
1179
1196
  parser = argparse.ArgumentParser(allow_abbrev=False)
1180
1197
 
1181
1198
  # Positional
1182
- parser.add_argument("command", help="debug|deploy")
1199
+ parser.add_argument("command", help="debug|deploy|reset")
1183
1200
  parser.add_argument("project_path", nargs='?', default=os.getcwd(), help="Path to connector project directory")
1184
1201
 
1185
1202
  # Optional (Not all of these are valid with every mutually exclusive option below)
@@ -1232,6 +1249,20 @@ def main():
1232
1249
  port = 50051 if not args.port else args.port
1233
1250
  connector_object.debug(args.project_path, port, configuration, state)
1234
1251
 
1252
+ elif args.command.lower() == "reset":
1253
+ files_path = os.path.join(args.project_path, OUTPUT_FILES_DIR)
1254
+ confirm = input("This will delete your current state and `warehouse.db` files. Do you want to continue? (Y/N): ")
1255
+ if confirm.lower() != "y":
1256
+ print("INFO: Reset canceled")
1257
+ else:
1258
+ try:
1259
+ if os.path.exists(files_path) and os.path.isdir(files_path):
1260
+ shutil.rmtree(files_path)
1261
+ print("INFO: Reset Successful")
1262
+ except Exception as e:
1263
+ print("ERROR: Reset Failed")
1264
+ raise e
1265
+
1235
1266
  else:
1236
1267
  raise NotImplementedError("Invalid command: ", args.command)
1237
1268
 
@@ -0,0 +1,56 @@
1
+ Metadata-Version: 2.1
2
+ Name: fivetran_connector_sdk
3
+ Version: 0.8.20.1
4
+ Summary: Build custom connectors on Fivetran platform
5
+ Author-email: Fivetran <developers@fivetran.com>
6
+ Project-URL: Homepage, https://fivetran.com/docs/connectors/connector-sdk
7
+ Project-URL: Github, https://github.com/fivetran/fivetran_connector_sdk
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: grpcio==1.60.1
14
+ Requires-Dist: grpcio-tools==1.60.1
15
+ Requires-Dist: requests==2.31.0
16
+ Requires-Dist: get_pypi_latest_version==0.0.12
17
+ Requires-Dist: pipreqs==0.5.0
18
+
19
+ # **fivetran-connector-sdk**
20
+ The *fivetran-connector-sdk* is a Python module that enables you to write custom data connectors and deploy them as an extension of [Fivetran](https://www.fivetran.com/). Fivetran automatically manages running the connectors on your scheduled frequency and manages the required compute resources.
21
+
22
+ The Connector SDK service is the best fit for the following use cases:
23
+ - Fivetran doesn't have a connector for your source and is unlikely to support it soon.
24
+ - You are using private APIs, custom applications, unsupported file formats, or those that require pre-processing.
25
+ - You have sensitive data that needs filtering or anonymizing before entering the destination.
26
+ - You don't want to introduce a 3rd party into your pipeline (e.g., to host a custom function).
27
+
28
+ To learn more, see our [Connector SDK documentation](https://fivetran.com/docs/connectors/connector-sdk)
29
+
30
+ ## **Install**
31
+
32
+ pip install fivetran-connector-sdk
33
+
34
+ ## **Requirements**
35
+ - Python ≥3.9 and ≤3.12
36
+ - Operating System:
37
+ - Windows 10 or later
38
+ - MacOS 13 (Ventura) or later
39
+
40
+ ## **Getting started**
41
+ See [Quickstart guide](https://fivetran.com/docs/connectors/connector-sdk/quickstart-guide) to get started.
42
+
43
+ ## **Usage**
44
+ Import required classes from fivetran_connector_sdk to begin writing your custom data connector
45
+
46
+ ```python
47
+ from fivetran_connector_sdk import Connector
48
+ from fivetran_connector_sdk import Logging as log
49
+ from fivetran_connector_sdk import Operations as op
50
+ ```
51
+ See our [Technical Reference](https://fivetran.com/docs/connectors/connector-sdk/technical-reference#update) and [Best Practices](https://fivetran.com/docs/connectors/connector-sdk/best-practices) documentation for more details.
52
+
53
+ You can also refer to our [existing examples](https://github.com/fivetran/fivetran_connector_sdk) to better understand Fivetran's Connector SDK and start creating custom data connectors.
54
+
55
+ ## **Maintenance**
56
+ This package is actively maintained by Fivetran Developers. Please reach out to our [Support team](https://support.fivetran.com/hc/en-us) for any inquiries.
@@ -1,3 +1,4 @@
1
+ README.md
1
2
  pyproject.toml
2
3
  src/fivetran_connector_sdk/__init__.py
3
4
  src/fivetran_connector_sdk.egg-info/PKG-INFO
@@ -1,17 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: fivetran_connector_sdk
3
- Version: 0.8.19.1
4
- Summary: Build custom connectors on Fivetran platform
5
- Author-email: Fivetran <developers@fivetran.com>
6
- Project-URL: Homepage, https://fivetran.com/docs/connectors/connector-sdk
7
- Project-URL: Github, https://github.com/fivetran/fivetran_connector_sdk
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.9
12
- Description-Content-Type: text/markdown
13
- Requires-Dist: grpcio==1.60.1
14
- Requires-Dist: grpcio-tools==1.60.1
15
- Requires-Dist: requests==2.31.0
16
- Requires-Dist: get_pypi_latest_version==0.0.12
17
- Requires-Dist: pipreqs==0.5.0
@@ -1,17 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: fivetran_connector_sdk
3
- Version: 0.8.19.1
4
- Summary: Build custom connectors on Fivetran platform
5
- Author-email: Fivetran <developers@fivetran.com>
6
- Project-URL: Homepage, https://fivetran.com/docs/connectors/connector-sdk
7
- Project-URL: Github, https://github.com/fivetran/fivetran_connector_sdk
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.9
12
- Description-Content-Type: text/markdown
13
- Requires-Dist: grpcio==1.60.1
14
- Requires-Dist: grpcio-tools==1.60.1
15
- Requires-Dist: requests==2.31.0
16
- Requires-Dist: get_pypi_latest_version==0.0.12
17
- Requires-Dist: pipreqs==0.5.0