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

Total release size: 174.6 MB

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

Download URL tng_sdk-2.9.1-py3-none-win_amd64.whl
Size 38.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
d67acbfe21f3b311650afb7eb9102735163c6037f5ea1a93e0711acd6e503d62
BLAKE2b-256 checksum
How to use checksums
d434ebacb3640eeb9be675b67cf15f66918388f8843263b1deced0f84c0599d6
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 4, 2026.

Transparency log

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

Download URL tng_sdk-2.9.1-py3-none-manylinux_2_17_x86_64.whl
Size 33.1 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
dcb21198036520a8a444e5c18ed793b3a3c183621b7772ae36d0a234346e4428
BLAKE2b-256 checksum
How to use checksums
00fc80dab62f83bf5b8176908234ec1dd3bbe45349122b7b557215e729c9a7e1
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 4, 2026.

Transparency log

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

Download URL tng_sdk-2.9.1-py3-none-manylinux_2_17_aarch64.whl
Size 31.2 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
5e1a5d127abbdd38a2724d89b19f9adacfb70bd86014ed73b29b2bf5d15786ed
BLAKE2b-256 checksum
How to use checksums
9fa82b5442fdf2506e6784d38da9cd4c59d368b4f2796b38e5aa986c7cd7edb0
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 4, 2026.

Transparency log

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

Download URL tng_sdk-2.9.1-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
f99ebf9718d810e9dcd05157cf312cb06e8800c3aa934e7590506478e452d38d
BLAKE2b-256 checksum
How to use checksums
f33571e40ac3b666708ae42244dbdefd8906ff94065a0d7d52397292b7fec19e
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 4, 2026.

Transparency log

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

Download URL tng_sdk-2.9.1-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
263695300773e6a49467b50c67f14a95d90aca554b3b4f4949a584b27c3a896c
BLAKE2b-256 checksum
How to use checksums
f62dd8ddf5d9c96cdc831655b553d35304d11ce156fce72d9caa4c751423c716
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 4, 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

This release

2.9.1 This release

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