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

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

Total release size: 184.4 MB

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

Download URL tng_sdk-2.10.1-py3-none-win_amd64.whl
Size 41.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
e55fa54d212e76f947bd276baea37a50bbbd84b02eebba4c91a8166033913907
BLAKE2b-256 checksum
How to use checksums
632d0923a5cdab832c0212653fa5a82c77bfc430ef8a2bcd21cf6b5decc261cb
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 24, 2026.

Transparency log

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

Download URL tng_sdk-2.10.1-py3-none-manylinux_2_17_x86_64.whl
Size 35.0 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
aecbfc04c28c8622c21a76993325ef40349feb9e930db553618ab6b6b141ce19
BLAKE2b-256 checksum
How to use checksums
b5249e64cbdc40c7e16ccb3ca2283ce94134d3bf0ce2711e818cfefd85fca674
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 24, 2026.

Transparency log

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

Download URL tng_sdk-2.10.1-py3-none-manylinux_2_17_aarch64.whl
Size 33.0 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
90f88c47f712f93bb3f8ffb7b291a3a9e07f5fee17da29fc0e12ebc828941386
BLAKE2b-256 checksum
How to use checksums
3b6f7066b5cb0efd4181f6e680e911238cc4046bc5eb4e09d55f239c65ca812d
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 24, 2026.

Transparency log

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

Download URL tng_sdk-2.10.1-py3-none-macosx_11_0_x86_64.whl
Size 38.4 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
88ef0611b1a842ccde9d1c747c63ba4d5bffd52057560f1557633a03afedcf09
BLAKE2b-256 checksum
How to use checksums
7bd85efb241ea10d4c4c92ea3ee44bb3f8a6cafb099ceb5a37448064e5fd9b28
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 24, 2026.

Transparency log

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

Download URL tng_sdk-2.10.1-py3-none-macosx_11_0_arm64.whl
Size 36.8 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2add0ad5a07ae49fe0e98352c6eb5a2fc2c2b1666ca5ea6faa0b266677e3edfd
BLAKE2b-256 checksum
How to use checksums
b09fd3732a87d4448c21aef34ef8a011aef071cf8ee26754e6e3db16cdbbca78
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 24, 2026.

Transparency log

Release history Release notifications | RSS feed

2.11.0

5 release files

This release

2.10.1 This release

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