external-systems 0.3.0__py3-none-any.whl → 0.101.0rc1__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.
Potentially problematic release.
This version of external-systems might be problematic. Click here for more details.
- external_systems/_version.py +1 -1
- external_systems/sources/_sources.py +1 -1
- external_systems-0.101.0rc1.dist-info/METADATA +148 -0
- {external_systems-0.3.0.dist-info → external_systems-0.101.0rc1.dist-info}/RECORD +6 -6
- external_systems-0.3.0.dist-info/METADATA +0 -75
- {external_systems-0.3.0.dist-info → external_systems-0.101.0rc1.dist-info}/LICENSE.txt +0 -0
- {external_systems-0.3.0.dist-info → external_systems-0.101.0rc1.dist-info}/WHEEL +0 -0
external_systems/_version.py
CHANGED
|
@@ -104,7 +104,7 @@ class Source:
|
|
|
104
104
|
new_ca_contents.append(required_ca)
|
|
105
105
|
|
|
106
106
|
with NamedTemporaryFile(delete=False, mode="w") as ca_bundle_file:
|
|
107
|
-
ca_bundle_file.write(
|
|
107
|
+
ca_bundle_file.write("".join(new_ca_contents) + os.linesep)
|
|
108
108
|
return ca_bundle_file.name
|
|
109
109
|
|
|
110
110
|
@cached_property
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: external-systems
|
|
3
|
+
Version: 0.101.0rc1
|
|
4
|
+
Summary: A Python library for interacting with Foundry Sources
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
Keywords: Palantir,Foundry,Sources,Compute Modules,Python Functions,Transforms
|
|
7
|
+
Author: Palantir Technologies, Inc.
|
|
8
|
+
Requires-Python: >=3.9,<4.0
|
|
9
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Dist: frozendict (>=2.4.6,<3.0.0)
|
|
17
|
+
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
18
|
+
Project-URL: Repository, https://github.com/palantir/external-systems
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# External Systems
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
[](https://pypi.org/project/external-systems/)
|
|
25
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
26
|
+
<a href="https://autorelease.general.dmz.palantir.tech/palantir/external-systems"><img src="https://img.shields.io/badge/Perform%20an-Autorelease-success.svg" alt="Autorelease"></a>
|
|
27
|
+
|
|
28
|
+
> [!WARNING]
|
|
29
|
+
> This SDK is incubating and subject to change.
|
|
30
|
+
|
|
31
|
+
## About Foundry Sources
|
|
32
|
+
|
|
33
|
+
The External Systems library is Python SDK built as an interface to reference [Foundry Sources](https://www.palantir.com/docs/foundry/data-connection/set-up-source) from code.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
You can install the Python package using `pip`:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
pip install external-systems
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Basic Source Usage
|
|
44
|
+
|
|
45
|
+
### HTTP Client
|
|
46
|
+
|
|
47
|
+
For REST based sources, a preconfigured HTTP client is provided built on top of the Python requests library. For on-prem systems using [Agent Proxy](https://www.palantir.com/docs/foundry/data-connection/agent-proxy-runtime) the client will be pre-configured with the corresponding proxy
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from external_systems.sources import Source, HttpsConnection
|
|
51
|
+
from requests import Session
|
|
52
|
+
|
|
53
|
+
my_source: Source = ...
|
|
54
|
+
|
|
55
|
+
https_connection: HttpsConnection = my_source.get_https_connection()
|
|
56
|
+
|
|
57
|
+
source_url: str = https_connection.url
|
|
58
|
+
http_client: Session = https_connection.get_client()
|
|
59
|
+
|
|
60
|
+
response = http_client.get(source_url + "/api/v1/example/", timeout=10)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Secrets
|
|
64
|
+
|
|
65
|
+
Source secrets can be referenced using `get_secret("<secret_name>")` on the source.
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
from external_systems.sources import Source
|
|
69
|
+
|
|
70
|
+
my_source: Source = ...
|
|
71
|
+
|
|
72
|
+
some_secret: str = my_source.get_secret("SECRET_NAME")
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
For sources using session credentials we support credentials generation and refresh management. Currently on an S3 source you can access session credentials using `get_aws_credentials()`. This method will throw if the source is not pre-configured with `AwsCredentials`
|
|
76
|
+
|
|
77
|
+
_Session credentials may not be available in all Foundry runtime environments_
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
from external_systems.sources import Source, Refreshable, AwsCredentials
|
|
81
|
+
|
|
82
|
+
s3_source: Source = ...
|
|
83
|
+
|
|
84
|
+
refreshable_credentials: Refreshable[AwsCredentials] = s3_source.get_aws_credentials()
|
|
85
|
+
|
|
86
|
+
session_credentials: AwsCredentials = refreshable_credentials.get()
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## On-prem Connectivity with [Foundry Agent Proxy](https://www.palantir.com/docs/foundry/data-connection/agent-proxy-runtime)
|
|
90
|
+
|
|
91
|
+
### Socket
|
|
92
|
+
|
|
93
|
+
For non-HTTP connections to external systems that require connections through Foundry's agent proxy, a pre-configured socket is provided.
|
|
94
|
+
|
|
95
|
+
#### On-Prem SFTP Server Example
|
|
96
|
+
|
|
97
|
+
For this example we'll be using the [fabric](https://docs.fabfile.org/en/latest/) library
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
import fabric
|
|
101
|
+
|
|
102
|
+
from external_systems.sources import Source
|
|
103
|
+
from socket import socket
|
|
104
|
+
|
|
105
|
+
SFTP_HOST = <sftp_host>
|
|
106
|
+
SFTP_PORT = <sftp_port>
|
|
107
|
+
|
|
108
|
+
on_prem_proxied_source: Source = ...
|
|
109
|
+
|
|
110
|
+
username: str = on_prem_sftp_server.get_secret("username")
|
|
111
|
+
password: str = on_prem_sftp_server.get_secret("password")
|
|
112
|
+
|
|
113
|
+
proxy_socket: socket = source.create_socket(SFTP_HOST, SFTP_PORT)
|
|
114
|
+
|
|
115
|
+
with fabric.Connection(
|
|
116
|
+
SFTP_HOST,
|
|
117
|
+
user=username,
|
|
118
|
+
port=SFTP_PORT,
|
|
119
|
+
connect_kwargs={
|
|
120
|
+
"password": password,
|
|
121
|
+
"sock": proxy_socket,
|
|
122
|
+
},
|
|
123
|
+
) as conn:
|
|
124
|
+
sftp = conn.sftp()
|
|
125
|
+
file_list = sftp.listdir(".")
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Authenticated Proxy URI
|
|
129
|
+
|
|
130
|
+
For more granular use cases a pre-authenticated proxy URI is provided to allow connections to on-prem external systems.
|
|
131
|
+
|
|
132
|
+
#### Example
|
|
133
|
+
|
|
134
|
+
We'll be using the [httpx](https://www.python-httpx.org/) library.
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
import httpx
|
|
138
|
+
|
|
139
|
+
from external_systems.sources import Source
|
|
140
|
+
|
|
141
|
+
on_prem_system: Source = ...
|
|
142
|
+
|
|
143
|
+
authenticated_proxy_uri: str = on_prem_system.get_https_proxy_uri()
|
|
144
|
+
|
|
145
|
+
with httpx.Client(proxy=authenticated_proxy_uri) as client:
|
|
146
|
+
...
|
|
147
|
+
```
|
|
148
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
external_systems/__init__.py,sha256=xXDUDD6_qRO-nHuXZx-fXp0R0vc3N_OOsB1F5mF_kpU,651
|
|
2
|
-
external_systems/_version.py,sha256=
|
|
2
|
+
external_systems/_version.py,sha256=N_OT8GSgh_pMnTl0dkeDpuTSWMuGOu4jYURetRcOxoo,753
|
|
3
3
|
external_systems/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
external_systems/sources/__init__.py,sha256=aqXbMIy_pnyIC1uPRzQfApLCbhYB4N8iRFnpOX4RdAk,1156
|
|
5
5
|
external_systems/sources/_api.py,sha256=NV7oNIgzSWz4ROFW8uPpUJjDN5vfFzdTs3yKC37S39k,3262
|
|
@@ -7,9 +7,9 @@ external_systems/sources/_connections.py,sha256=h82npEks29NALAAfMHrXcSnB7TY_OLeX
|
|
|
7
7
|
external_systems/sources/_proxies.py,sha256=igWRL-kpQ_IlZyJwI_s66rDe0oQ68ltGeFNydgoiR4w,5071
|
|
8
8
|
external_systems/sources/_refreshable.py,sha256=0pa5XW0_2gTMW-ZymKhlhh3Kka_bWTWffThKvrTTifc,4421
|
|
9
9
|
external_systems/sources/_sockets.py,sha256=XH51adVnloqg8XYVHPxl6K8R_q2BCh6WZ77cq1L8nRg,4473
|
|
10
|
-
external_systems/sources/_sources.py,sha256
|
|
10
|
+
external_systems/sources/_sources.py,sha256=Nqu61CGKyUlErtImCz6tmq8y9RYeEJJ6AGHXA4o5HwA,10821
|
|
11
11
|
external_systems/sources/_utils.py,sha256=EmUKKiKRDOZ2cZs7FZ4qCSan_lq1K_tquh3kxleB-jA,1004
|
|
12
|
-
external_systems-0.
|
|
13
|
-
external_systems-0.
|
|
14
|
-
external_systems-0.
|
|
15
|
-
external_systems-0.
|
|
12
|
+
external_systems-0.101.0rc1.dist-info/LICENSE.txt,sha256=NAk6Uc9K_N_J5V75k9qECpzUnO-ujT-mKK_jk_mboUE,569
|
|
13
|
+
external_systems-0.101.0rc1.dist-info/METADATA,sha256=iwk3B8NnMd41HaKF-sM7MI9SPAJ8T3JbeKLdWS5X4gI,4768
|
|
14
|
+
external_systems-0.101.0rc1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
15
|
+
external_systems-0.101.0rc1.dist-info/RECORD,,
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: external-systems
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: A Python library for interacting with Foundry Sources
|
|
5
|
-
License: Apache-2.0
|
|
6
|
-
Keywords: Palantir,Foundry,Sources,Compute Modules,Python Functions,Transforms
|
|
7
|
-
Author: Palantir Technologies, Inc.
|
|
8
|
-
Requires-Python: >=3.9,<4.0
|
|
9
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
-
Requires-Dist: frozendict (>=2.4.6,<3.0.0)
|
|
17
|
-
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
18
|
-
Project-URL: Repository, https://github.com/palantir/external-systems
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
|
|
21
|
-
# External Systems
|
|
22
|
-

|
|
23
|
-
[](https://pypi.org/project/external-systems/)
|
|
24
|
-
[](https://opensource.org/licenses/Apache-2.0)
|
|
25
|
-
<a href="https://autorelease.general.dmz.palantir.tech/palantir/external-systems"><img src="https://img.shields.io/badge/Perform%20an-Autorelease-success.svg" alt="Autorelease"></a>
|
|
26
|
-
|
|
27
|
-
> [!WARNING]
|
|
28
|
-
> This SDK is incubating and subject to change.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
## About Foundry Sources
|
|
32
|
-
|
|
33
|
-
The External Systems library is Python SDK built as an interface to reference [Foundry Sources](https://www.palantir.com/docs/foundry/data-connection/set-up-source) from code.
|
|
34
|
-
|
|
35
|
-
<a id="installation"></a>
|
|
36
|
-
## Installation
|
|
37
|
-
You can install the Python package using `pip`:
|
|
38
|
-
|
|
39
|
-
```sh
|
|
40
|
-
pip install external-systems
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
<a id="basic-usage"></a>
|
|
44
|
-
## Basic Source Usage
|
|
45
|
-
|
|
46
|
-
### Credentials
|
|
47
|
-
|
|
48
|
-
Long lived credentials can be referenced using `get_secret()` on the source.
|
|
49
|
-
|
|
50
|
-
```python
|
|
51
|
-
my_source: Source = ...
|
|
52
|
-
|
|
53
|
-
some_secret = my_source.get_secret("SECRET_NAME")
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
For sources using session credentials we support credentials generation and refresh management. Currently on an S3 source you can access session credentials using `get_aws_credentials()`.
|
|
57
|
-
|
|
58
|
-
```python
|
|
59
|
-
s3_source: Source = ...
|
|
60
|
-
|
|
61
|
-
refreshable_credentials: Refreshable[AwsCredentials] = s3_source.get_aws_credentials()
|
|
62
|
-
|
|
63
|
-
session_credentials: AwsCredentials = refreshable_credentials.get()
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### HTTP Client
|
|
67
|
-
For REST based sources, a preconfigured HTTP client is provided built on top of the Python requests library.
|
|
68
|
-
|
|
69
|
-
```python
|
|
70
|
-
source_url = my_source.get_https_connection().url
|
|
71
|
-
http_client = my_source.get_https_connection().get_client()
|
|
72
|
-
|
|
73
|
-
response = http_client.get(source_url + "/api/v1/example/", timeout=10)
|
|
74
|
-
```
|
|
75
|
-
|
|
File without changes
|
|
File without changes
|