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

Total release size: 188.7 MB

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

Download URL tng_sdk-2.12.0-py3-none-win_amd64.whl
Size 42.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
fa154df8ced5793fdd8a29996dadfc9076af98d9ed2bc3d3fc476ada95033846
BLAKE2b-256 checksum
How to use checksums
61618ca790e1276641b6ae6cfb924f11a513740c9eb58f0cf93d178d237727f3
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 Oct 25, 2026.

Transparency log

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

Download URL tng_sdk-2.12.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
dc75b43e3e2a4b83908be3eea46a79083ce756fda678eca601da5952308859ae
BLAKE2b-256 checksum
How to use checksums
aa7679e966f5f7c2132f30dea9a735bc7e133a3bf7834f7182e1cd31b46b3720
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 Oct 25, 2026.

Transparency log

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

Download URL tng_sdk-2.12.0-py3-none-manylinux_2_17_aarch64.whl
Size 33.9 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
a42c9c45ca5912fc56a3ab83db782f06133038580e9506508cdc9af0d2232bfc
BLAKE2b-256 checksum
How to use checksums
d81141a9f5ccf990e1b29b58bda684402a1a1081e81079e5d7106e21dde4f96a
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 Oct 25, 2026.

Transparency log

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

Download URL tng_sdk-2.12.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
712d31a1fb33f6946dc726dc09a8833a26b821e10f0fcd43abf6fae7f7192821
BLAKE2b-256 checksum
How to use checksums
d527e3c7e030cea62ce866fe6817505ad11ef979cbec75a5bb1e2dec315797e9
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 Oct 25, 2026.

Transparency log

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

Download URL tng_sdk-2.12.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
2ef69591e1994a000ac0da5da908b0a66328363c3f5d84d4c2790c843ef0ba79
BLAKE2b-256 checksum
How to use checksums
462293619258b6d318061540a20ee30efe48fd1d3ac0b77c6f73cfb7eb5f3a1e
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 Oct 25, 2026.

Transparency log

Security for tng-sdk 2.12.0

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

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for tng_sdk-2.12.0-py3-none-win_amd64.whl

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 Oct 25, 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.

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