fivetran-connector-sdk 0.8.19.1__py3-none-any.whl → 0.8.20.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.
- fivetran_connector_sdk/__init__.py +50 -19
- fivetran_connector_sdk-0.8.20.1.dist-info/METADATA +56 -0
- {fivetran_connector_sdk-0.8.19.1.dist-info → fivetran_connector_sdk-0.8.20.1.dist-info}/RECORD +6 -6
- {fivetran_connector_sdk-0.8.19.1.dist-info → fivetran_connector_sdk-0.8.20.1.dist-info}/WHEEL +1 -1
- fivetran_connector_sdk-0.8.19.1.dist-info/METADATA +0 -18
- {fivetran_connector_sdk-0.8.19.1.dist-info → fivetran_connector_sdk-0.8.20.1.dist-info}/entry_points.txt +0 -0
- {fivetran_connector_sdk-0.8.19.1.dist-info → fivetran_connector_sdk-0.8.20.1.dist-info}/top_level.txt +0 -0
@@ -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.
|
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
|
-
|
778
|
-
|
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(
|
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
|
-
|
785
|
-
groups =
|
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
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
print(
|
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
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
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.
|
{fivetran_connector_sdk-0.8.19.1.dist-info → fivetran_connector_sdk-0.8.20.1.dist-info}/RECORD
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
fivetran_connector_sdk/__init__.py,sha256=
|
1
|
+
fivetran_connector_sdk/__init__.py,sha256=18kC57Mt5p2AfmN6hxZsYg-EVo003vjxR9TdAlSWkUk,51079
|
2
2
|
fivetran_connector_sdk/protos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
fivetran_connector_sdk/protos/common_pb2.py,sha256=kUwVcyZHgLigNR-KnHZn7dHrlxaMnUXqzprsRx6T72M,6831
|
4
4
|
fivetran_connector_sdk/protos/common_pb2.pyi,sha256=S0hdIzoXyyOKD5cjiGeDDLYpQ9J3LjAvu4rCj1JvJWE,9038
|
@@ -6,8 +6,8 @@ fivetran_connector_sdk/protos/common_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXH
|
|
6
6
|
fivetran_connector_sdk/protos/connector_sdk_pb2.py,sha256=9Ke_Ti1s0vAeXapfXT-EryrT2-TSGQb8mhs4gxTpUMk,7732
|
7
7
|
fivetran_connector_sdk/protos/connector_sdk_pb2.pyi,sha256=FWYxRgshEF3QDYAE0TM_mv4N2gGvkxCH_uPpxnMc4oA,8406
|
8
8
|
fivetran_connector_sdk/protos/connector_sdk_pb2_grpc.py,sha256=ZfJLp4DW7uP4pFOZ74s_wQ6tD3eIPi-08UfnLwe4tzo,7163
|
9
|
-
fivetran_connector_sdk-0.8.
|
10
|
-
fivetran_connector_sdk-0.8.
|
11
|
-
fivetran_connector_sdk-0.8.
|
12
|
-
fivetran_connector_sdk-0.8.
|
13
|
-
fivetran_connector_sdk-0.8.
|
9
|
+
fivetran_connector_sdk-0.8.20.1.dist-info/METADATA,sha256=ZT9EH4kHxUWQJOvVKp59s30-itzzO0Izn1Qz94t_cGg,2795
|
10
|
+
fivetran_connector_sdk-0.8.20.1.dist-info/WHEEL,sha256=nCVcAvsfA9TDtwGwhYaRrlPhTLV9m-Ga6mdyDtuwK18,91
|
11
|
+
fivetran_connector_sdk-0.8.20.1.dist-info/entry_points.txt,sha256=uQn0KPnFlQmXJfxlk0tifdNsSXWfVlnAFzNqjXZM_xM,57
|
12
|
+
fivetran_connector_sdk-0.8.20.1.dist-info/top_level.txt,sha256=-_xk2MFY4psIh7jw1lJePMzFb5-vask8_ZtX-UzYWUI,23
|
13
|
+
fivetran_connector_sdk-0.8.20.1.dist-info/RECORD,,
|
@@ -1,18 +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
|
18
|
-
|
File without changes
|
File without changes
|