external-systems


Nameexternal-systems JSON
Version 0.107.0 PyPI version JSON
download
home_pagehttps://github.com/palantir/external-systems
SummaryA Python library for interacting with Foundry Sources
upload_time2025-07-28 22:46:24
maintainerNone
docs_urlNone
authorPalantir Technologies, Inc.
requires_python<4.0,>=3.9
licenseApache-2.0
keywords palantir foundry sources compute modules python functions transforms
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # External Systems

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/external-systems)
[![PyPI](https://img.shields.io/pypi/v/external-systems)](https://pypi.org/project/external-systems/)
[![License](https://img.shields.io/badge/License-Apache%202.0-lightgrey.svg)](https://opensource.org/licenses/Apache-2.0)
<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>

> [!WARNING]
> This SDK is incubating and subject to change.

## About Foundry Sources

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.

## Installation

You can install the Python package using `pip`:

```sh
pip install external-systems
```

## Basic Source Usage

### HTTP Client

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

```python
from external_systems.sources import Source, HttpsConnection
from requests import Session

my_source: Source = ...

https_connection: HttpsConnection = my_source.get_https_connection()

source_url: str = https_connection.url
http_client: Session = https_connection.get_client()

response = http_client.get(source_url + "/api/v1/example/", timeout=10)
```

### Secrets

Source secrets can be referenced using `get_secret("<secret_name>")` on the source.

```python
from external_systems.sources import Source

my_source: Source = ...

some_secret: str = my_source.get_secret("SECRET_NAME")
```

For sources using session credentials we support credentials generation and refresh management. This can be done by using `get_session_credentials` which supports `S3`, `BigQuery`, `Google Cloud Storage` sources.

_Session credentials may not be available in all Foundry runtime environments_

```python
from external_systems.sources import Source, Refreshable, SourceCredentials, AwsCredentials

s3_source: Source = ...

refreshable_credentials: Refreshable[SourceCredentials] = s3_source.get_session_credentials()

session_credentials: SourceCredentials = refreshable_credentials.get()

if not isinstance(session_credentials, AwsCredentials):
    raise ...
```

## On-prem Connectivity with [Foundry Agent Proxy](https://www.palantir.com/docs/foundry/data-connection/agent-proxy-runtime)

### Socket

For non-HTTP connections to external systems that require connections through Foundry's agent proxy, a pre-configured socket is provided.

#### On-Prem SFTP Server Example

For this example we'll be using the [fabric](https://docs.fabfile.org/en/latest/) library

```python
import fabric

from external_systems.sources import Source
from socket import socket

SFTP_HOST = <sftp_host>
SFTP_PORT = <sftp_port>

on_prem_proxied_source: Source = ...

username: str = on_prem_sftp_server.get_secret("username")
password: str = on_prem_sftp_server.get_secret("password")

proxy_socket: socket = source.create_socket(SFTP_HOST, SFTP_PORT)

with fabric.Connection(
    SFTP_HOST,
    user=username,
    port=SFTP_PORT,
    connect_kwargs={
        "password": password,
        "sock": proxy_socket,
    },
) as conn:
    sftp = conn.sftp()
    file_list = sftp.listdir(".")
```

### Authenticated Proxy URI

For more granular use cases a pre-authenticated proxy URI is provided to allow connections to on-prem external systems.

#### Example

We'll be using the [httpx](https://www.python-httpx.org/) library.

```python
import httpx

from external_systems.sources import Source

on_prem_system: Source = ...

authenticated_proxy_uri: str = on_prem_system.get_https_proxy_uri()

with httpx.Client(proxy=authenticated_proxy_uri) as client:
    ...
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/palantir/external-systems",
    "name": "external-systems",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "Palantir, Foundry, Sources, Compute Modules, Python Functions, Transforms",
    "author": "Palantir Technologies, Inc.",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/19/14/b50a04b19de66eb3bf2314aac6683c91987bc54f870953d46932f48df65e/external_systems-0.107.0.tar.gz",
    "platform": null,
    "description": "# External Systems\n\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/external-systems)\n[![PyPI](https://img.shields.io/pypi/v/external-systems)](https://pypi.org/project/external-systems/)\n[![License](https://img.shields.io/badge/License-Apache%202.0-lightgrey.svg)](https://opensource.org/licenses/Apache-2.0)\n<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>\n\n> [!WARNING]\n> This SDK is incubating and subject to change.\n\n## About Foundry Sources\n\nThe 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.\n\n## Installation\n\nYou can install the Python package using `pip`:\n\n```sh\npip install external-systems\n```\n\n## Basic Source Usage\n\n### HTTP Client\n\nFor 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\n\n```python\nfrom external_systems.sources import Source, HttpsConnection\nfrom requests import Session\n\nmy_source: Source = ...\n\nhttps_connection: HttpsConnection = my_source.get_https_connection()\n\nsource_url: str = https_connection.url\nhttp_client: Session = https_connection.get_client()\n\nresponse = http_client.get(source_url + \"/api/v1/example/\", timeout=10)\n```\n\n### Secrets\n\nSource secrets can be referenced using `get_secret(\"<secret_name>\")` on the source.\n\n```python\nfrom external_systems.sources import Source\n\nmy_source: Source = ...\n\nsome_secret: str = my_source.get_secret(\"SECRET_NAME\")\n```\n\nFor sources using session credentials we support credentials generation and refresh management. This can be done by using `get_session_credentials` which supports `S3`, `BigQuery`, `Google Cloud Storage` sources.\n\n_Session credentials may not be available in all Foundry runtime environments_\n\n```python\nfrom external_systems.sources import Source, Refreshable, SourceCredentials, AwsCredentials\n\ns3_source: Source = ...\n\nrefreshable_credentials: Refreshable[SourceCredentials] = s3_source.get_session_credentials()\n\nsession_credentials: SourceCredentials = refreshable_credentials.get()\n\nif not isinstance(session_credentials, AwsCredentials):\n    raise ...\n```\n\n## On-prem Connectivity with [Foundry Agent Proxy](https://www.palantir.com/docs/foundry/data-connection/agent-proxy-runtime)\n\n### Socket\n\nFor non-HTTP connections to external systems that require connections through Foundry's agent proxy, a pre-configured socket is provided.\n\n#### On-Prem SFTP Server Example\n\nFor this example we'll be using the [fabric](https://docs.fabfile.org/en/latest/) library\n\n```python\nimport fabric\n\nfrom external_systems.sources import Source\nfrom socket import socket\n\nSFTP_HOST = <sftp_host>\nSFTP_PORT = <sftp_port>\n\non_prem_proxied_source: Source = ...\n\nusername: str = on_prem_sftp_server.get_secret(\"username\")\npassword: str = on_prem_sftp_server.get_secret(\"password\")\n\nproxy_socket: socket = source.create_socket(SFTP_HOST, SFTP_PORT)\n\nwith fabric.Connection(\n    SFTP_HOST,\n    user=username,\n    port=SFTP_PORT,\n    connect_kwargs={\n        \"password\": password,\n        \"sock\": proxy_socket,\n    },\n) as conn:\n    sftp = conn.sftp()\n    file_list = sftp.listdir(\".\")\n```\n\n### Authenticated Proxy URI\n\nFor more granular use cases a pre-authenticated proxy URI is provided to allow connections to on-prem external systems.\n\n#### Example\n\nWe'll be using the [httpx](https://www.python-httpx.org/) library.\n\n```python\nimport httpx\n\nfrom external_systems.sources import Source\n\non_prem_system: Source = ...\n\nauthenticated_proxy_uri: str = on_prem_system.get_https_proxy_uri()\n\nwith httpx.Client(proxy=authenticated_proxy_uri) as client:\n    ...\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A Python library for interacting with Foundry Sources",
    "version": "0.107.0",
    "project_urls": {
        "Homepage": "https://github.com/palantir/external-systems",
        "Repository": "https://github.com/palantir/external-systems"
    },
    "split_keywords": [
        "palantir",
        " foundry",
        " sources",
        " compute modules",
        " python functions",
        " transforms"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0efa7487d7bfca2bd988c5296a6db64dbfd2e93db5a55c54e2daddfcdc49a410",
                "md5": "433c0c9dfe8c86bd6948d755d73e39d7",
                "sha256": "85342065ff577df8018cfb61d02f612d8ea895720eca53125e02c94f6394fcbb"
            },
            "downloads": -1,
            "filename": "external_systems-0.107.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "433c0c9dfe8c86bd6948d755d73e39d7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 18044,
            "upload_time": "2025-07-28T22:46:23",
            "upload_time_iso_8601": "2025-07-28T22:46:23.692922Z",
            "url": "https://files.pythonhosted.org/packages/0e/fa/7487d7bfca2bd988c5296a6db64dbfd2e93db5a55c54e2daddfcdc49a410/external_systems-0.107.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1914b50a04b19de66eb3bf2314aac6683c91987bc54f870953d46932f48df65e",
                "md5": "288e999d834881e8dbbb78a4b0c56ef4",
                "sha256": "5d67baaa351212467a6d1b1dee3e9d267d30522341018df535e23c79b6c415b3"
            },
            "downloads": -1,
            "filename": "external_systems-0.107.0.tar.gz",
            "has_sig": false,
            "md5_digest": "288e999d834881e8dbbb78a4b0c56ef4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 12074,
            "upload_time": "2025-07-28T22:46:24",
            "upload_time_iso_8601": "2025-07-28T22:46:24.757179Z",
            "url": "https://files.pythonhosted.org/packages/19/14/b50a04b19de66eb3bf2314aac6683c91987bc54f870953d46932f48df65e/external_systems-0.107.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-28 22:46:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "palantir",
    "github_project": "external-systems",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "circle": true,
    "lcname": "external-systems"
}
        
Elapsed time: 0.86023s