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

Total release size: 188.5 MB

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

Download URL tng_sdk-2.11.0-py3-none-win_amd64.whl
Size 42.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
c649a9b4a98a1b0a97c2ffe11f6eb79fde922d8b2ba885de9c2c822a83145137
BLAKE2b-256 checksum
How to use checksums
3b5d2f8568ff480d80542af7bbed46d9745d5f613bb7c8bab16df0683b7b26f7
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 30, 2026.

Transparency log

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

Download URL tng_sdk-2.11.0-py3-none-manylinux_2_17_x86_64.whl
Size 35.8 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
bb23595be6d469ea2f7c7a7c904e10db0ed70c5bfa113d4589bdc5e35f3cc910
BLAKE2b-256 checksum
How to use checksums
8469d15132e52541d82b34d385ab554bf46eba7211abb52c1c2f94ff013dbf0f
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 30, 2026.

Transparency log

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

Download URL tng_sdk-2.11.0-py3-none-manylinux_2_17_aarch64.whl
Size 33.8 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
5253a178c7aad431e500f875f2583c20d5a14b3f328c47c2a93c2b64633320a7
BLAKE2b-256 checksum
How to use checksums
06b1bc6c10dc5595080b8584fb298086a083df50f367af15ac912bbde26279ff
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 30, 2026.

Transparency log

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

Download URL tng_sdk-2.11.0-py3-none-macosx_11_0_x86_64.whl
Size 39.3 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
bb4d50b538863a02f31e006a8f54b5b8d7c187719975cdf0e15bcf8fa1a21c37
BLAKE2b-256 checksum
How to use checksums
24317423fd064ef195fe563d593331b81910668be803722d8b9d7979673fffab
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 30, 2026.

Transparency log

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

Download URL tng_sdk-2.11.0-py3-none-macosx_11_0_arm64.whl
Size 37.6 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ad2898f16761bf368e5e5be4597ac91a6c31104e43486d245ee68663a51a9c1c
BLAKE2b-256 checksum
How to use checksums
fb2eeddab0fe0a6cfec96165201dc3266558d5111aafc83ce864c3132c1e0ad0
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 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.11.0 This release

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

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