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.2

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.2
File
tng_sdk-2.9.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
tng_sdk-2.9.2-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
tng_sdk-2.9.2-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
tng_sdk-2.9.2-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details
tng_sdk-2.9.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 174.7 MB

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

Download URL tng_sdk-2.9.2-py3-none-win_amd64.whl
Size 38.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
6a6e63f61b7567f56975885eb50e77e12b658264db2e6ad42e0c4ace79147979
BLAKE2b-256 checksum
How to use checksums
3ec39e51fe4931fc0d8ee3c9e63c3cea52c002f4ab351dc041ae13625a87b233
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 Sep 7, 2026.

Transparency log

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

Download URL tng_sdk-2.9.2-py3-none-manylinux_2_17_x86_64.whl
Size 33.2 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f8680bae6b6e0853405e28b2325f33479883388590dc01358c2163fd0f610815
BLAKE2b-256 checksum
How to use checksums
f5f80c104588ba02803f9e35b24fee6c3d57d2a5f45c93d2cbe200fd19ff670a
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 Sep 7, 2026.

Transparency log

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

Download URL tng_sdk-2.9.2-py3-none-manylinux_2_17_aarch64.whl
Size 31.3 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
8c2bc7d232b8ef203e9576988761622982a0a24225092cb326d7eb8e38d1b97e
BLAKE2b-256 checksum
How to use checksums
6c0481b8cefb158af0bfed96483f12a6c8442fca8609209000a1ff0aa4ed019a
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 Sep 7, 2026.

Transparency log

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

Download URL tng_sdk-2.9.2-py3-none-macosx_11_0_x86_64.whl
Size 36.4 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
84f895c3cd65c294c7c593985ab58db94c6b91be56174e6d19a4320a811b89f0
BLAKE2b-256 checksum
How to use checksums
0b0395604bec0947f09fe120aedd53b04ad448b9f93dad83edc9bc986dc703a5
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 Sep 7, 2026.

Transparency log

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

Download URL tng_sdk-2.9.2-py3-none-macosx_11_0_arm64.whl
Size 34.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
52111ba42230965f2b58b93c235b4d4bfb84827734bb18d42290444b5cc3606c
BLAKE2b-256 checksum
How to use checksums
4fed9c4fecc62ffbb99f547919aaf86d067f4a9dd5237384ba6dee83da1a3675
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 Sep 7, 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

This release

2.9.2 This release

5 release files

2.9.1

5 release files

2.9.0

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