Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

HTTP Extension for the TRAC Model Runtime

This extension allows tracdap-runtime models to make calls to external systems using HTTP and HTTPS.

  • Make HTTP endpoints available to models, to use directly in model code
  • Connection settings managed by the runtime for both local and deployed models
  • Supports http.client and urllib3

Models that make external calls are not considered repeatable, and will be flagged as not repeatable when they run on the TRAC platform.

Installing

The HTTP extension can be installed with pip:

$ pip install tracdap-ext-http

The package has the following dependencies:

  • tracdap-runtime (version 0.10.0-beta2 or later)
  • urllib3 (optional, version 2.x)

Using the http.client API

Here is a minimum working example of a TRAC model using the http.client API:

import tracdap.rt.api as trac
import http.client as hc

class TestModel(trac.TracModel):

    # ... define parameters, inputs and outputs

    def define_resources(self):

        return {
            "github": trac.define_external_system("http", hc.HTTPSConnection)
        }

    def run_model(self, ctx: trac.TracContext):

        with ctx.get_external_system("github", hc.HTTPSConnection) as github:

            github.connect()
            github.request("GET", "finos/tracdap/refs/heads/main/README.md")

            response = github.getresponse()
            response_text = response.read().decode("utf-8")
            first_line = response_text.splitlines()[0]

            ctx.log.info(first_line)

if __name__ == '__main__':
    import tracdap.rt.launch as launch
    launch.launch_model(TestModel, "config/job_config.yaml", "config/sys_config.yaml")

To make this example work, you will need to add github as a resource in the system config file:

resources:

  github:
    resourceType: EXTERNAL_SYSTEM
    protocol: http
    properties:
      host: raw.githubusercontent.com
      port: 443
      tls: true

The following configuration properties are supported:

  • host, string, required
  • port, int, optional
  • tls, bool, default = true
  • timeout, float, optional

Models using the client type HTTPSConnection will only work if tls = true is set in the configuration. Models requesting HTTPConnection will work with tls = true or tls = false, and will receive an HTTPSConnection if tls = true.

Using the urllib3 API

Here is a minimum working example of a TRAC model using the urllib3 API. In order to use this API, the urllib3 package must be installed.

import tracdap.rt.api as trac
import urllib3

class TestModel(trac.TracModel):

    # ... define parameters, inputs and outputs

    def define_resources(self):

        return {
            "github": trac.define_external_system("http", urllib3.HTTPSConnectionPool)
        }

    def run_model(self, ctx: trac.TracContext):

        with ctx.get_external_system("github", urllib3.HTTPSConnectionPool, timeout=10.0) as github:

            response = github.request("GET", "/finos/tracdap/refs/heads/main/README.md")

            response_text = response.data.decode("utf-8")
            first_line = response_text.splitlines()[0]

            ctx.log.info(first_line)

if __name__ == '__main__':
    import tracdap.rt.launch as launch
    launch.launch_model(TestModel, "config/job_config.yaml", "config/sys_config.yaml")

The resource configuration for the urllib3 API is identical to the http.client API.

Metadata

Release files for tracdap-ext-http 0.11.1.dev0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tracdap-ext-http 0.11.1.dev0
File Size Uploaded Provenance Actions
tracdap_ext_http-0.11.1.dev0.tar.gz 10.1 kB With provenance Details for tracdap_ext_http-0.11.1.dev0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tracdap-ext-http 0.11.1.dev0
File Interpreter ABI Platform Actions
tracdap_ext_http-0.11.1.dev0-py3-none-any.whl Python 3 none any Details for tracdap_ext_http-0.11.1.dev0-py3-none-any.whl

Total release size: 19.8 kB

Release files / tracdap_ext_http-0.11.1.dev0.tar.gz

Download URL tracdap_ext_http-0.11.1.dev0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a55bbdf1fb520f1f3255aaf95266a706cca0a517dd13a42ce2e00ad9b4493f8f
BLAKE2b-256 checksum
How to use checksums
47695124a5286b4d7182ab4b4e50d0ce54be846daa5f0332fe3455e025aaa254
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / tracdap_ext_http-0.11.1.dev0-py3-none-any.whl

Download URL tracdap_ext_http-0.11.1.dev0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff51e1d8cc7dc19e1c064a4089bd20858238e84d18da23ec4d5616d21a2da37e
BLAKE2b-256 checksum
How to use checksums
4a4258bd27decac521f836545a9971b5526ca0b8dd5b3070fa1f8b3aa7fb8b4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for tracdap-ext-http 0.11.1.dev0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tracdap_ext_http-0.11.1.dev0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page