Skip to main content

TNG Python SDK

PyPI

中文文档

Trusted Network Gateway (TNG) Python SDK — encrypted HTTP requests with remote attestation.

Quick Start

pip install tng-sdk
from tng import Tng
import requests

# Create TNG client (no_ra = disable remote attestation for testing)
tng = Tng(no_ra=True)

# Wrap a requests session
session = requests.Session()
tng.wrap_requests(session)

# All requests flow through the encrypted TNG tunnel
resp = session.get("http://tng-server:10001/api/data")
print(resp.json())

tng.close()

Supported Clients

Client Method
requests tng.wrap_requests(session)
httpx tng.wrap_httpx(client)
openai tng.wrap_openai(client)

Security Options

# Disable remote attestation (testing only)
tng = Tng(no_ra=True)

# With verifier
tng = Tng(verify={"as_addr": "http://127.0.0.1:8080/", "policy_ids": ["default"]})

# With attester
tng = Tng(attest={"aa_addr": "unix:///run/aa.sock", "model": "passport"})

# Bidirectional attestation
tng = Tng(
    attest={"aa_addr": "unix:///run/aa.sock"},
    verify={"as_addr": "http://127.0.0.1:8080/", "policy_ids": ["default"]}
)

Encryption Protocol

# OHTTP is the default
tng = Tng(no_ra=True)

# Use rats-TLS instead of OHTTP (mutually exclusive)
tng = Tng(no_ra=True, rats_tls={"multiplex": True})

Documentation

Metadata

Release files for tng-sdk 2.9.0

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

Built distributions (wheels)

Table of built distributions (wheels) for tng-sdk 2.9.0
File
tng_sdk-2.9.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
tng_sdk-2.9.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
tng_sdk-2.9.0-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
tng_sdk-2.9.0-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details
tng_sdk-2.9.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 173.8 MB

Release files / tng_sdk-2.9.0-py3-none-win_amd64.whl

Download URL tng_sdk-2.9.0-py3-none-win_amd64.whl
Size 38.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
f048e0bec0237d1d072bfdf2e4d84ad4ebcdecab588ef9a61b923dbb09d27eb6
BLAKE2b-256 checksum
How to use checksums
a5086a9813a6f072410070d94307bfee173ca33ce67517c87a673e1ebfd2014e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 31, 2026.

Transparency log

Release files / tng_sdk-2.9.0-py3-none-manylinux_2_17_x86_64.whl

Download URL tng_sdk-2.9.0-py3-none-manylinux_2_17_x86_64.whl
Size 33.0 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
a47cfe9e4a32a812c650a8715b462fb43d9aa92044b3731d7f28cb165c2216d3
BLAKE2b-256 checksum
How to use checksums
b727018536f1dba8dc0ce5a23db882a84e67c35e87d64c31715e0ea674e5ecf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 31, 2026.

Transparency log

Release files / tng_sdk-2.9.0-py3-none-manylinux_2_17_aarch64.whl

Download URL tng_sdk-2.9.0-py3-none-manylinux_2_17_aarch64.whl
Size 31.1 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
f4fbbb92369fa936a6ea6025989ef63b219930476f6a1ec55f3f536b6be3796d
BLAKE2b-256 checksum
How to use checksums
8b40bcd1d99fedcac22d8037f603e6caf1fe8638643bd1e86524f2957d2aa11b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 31, 2026.

Transparency log

Release files / tng_sdk-2.9.0-py3-none-macosx_11_0_x86_64.whl

Download URL tng_sdk-2.9.0-py3-none-macosx_11_0_x86_64.whl
Size 36.2 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
b3db1a0e3689ff2327f7d322dc85bfdf5a5e43ed0189c745ca7f2f9184d036b7
BLAKE2b-256 checksum
How to use checksums
52fed1d7233a978fd4f970723ba97cc806d8bbc8b813140e25d533dd6e3eb99f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 31, 2026.

Transparency log

Release files / tng_sdk-2.9.0-py3-none-macosx_11_0_arm64.whl

Download URL tng_sdk-2.9.0-py3-none-macosx_11_0_arm64.whl
Size 34.7 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
da35103df7bb9cf67b309e8c5a5a86014a737d2801ad7f0bf13c071ad23fd694
BLAKE2b-256 checksum
How to use checksums
3f1236ecb21d76abf406469624325fe76216e74c12fac42f1d5257f36c79fc9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 31, 2026.

Transparency log

Release history Release notifications | RSS feed

2.11.0

5 release files

2.10.1

5 release files

2.10.0

5 release files

2.9.2

5 release files

2.9.1

5 release files

This release

2.9.0 This release

5 release files

2.7.3

5 release files

2.7.2

1 release file

2.7.1

1 release file

2.7.0

1 release file

2.6.0

1 release file

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