TNG Python SDK
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
- Getting Started — Complete installation, usage, and configuration guide
- Getting Started (中文) — 完整的安装、使用和配置指南
Metadata
Release files for tng-sdk 2.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| tng_sdk-2.10.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| tng_sdk-2.10.0-py3-none-manylinux_2_17_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details |
| tng_sdk-2.10.0-py3-none-manylinux_2_17_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details |
| tng_sdk-2.10.0-py3-none-macosx_11_0_x86_64.whl | Python 3 | none | macOS 11.0+ x86-64 | Details |
| tng_sdk-2.10.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
Total release size: 184.0 MB
Release files / tng_sdk-2.10.0-py3-none-win_amd64.whl
| Download URL | tng_sdk-2.10.0-py3-none-win_amd64.whl |
|---|---|
| Size | 41.1 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
53bdd0db6030d9ef20f55b95f9b8fd47dd17411d0d167dbaf6ccfaebefe49277
|
|
BLAKE2b-256 checksum How to use checksums |
f0fb0ee386ca4bb9f584bbf1e8178f070576cc883a713c952e9289fc1406e8b3
|
| 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 23, 2026.
Transparency logRelease files / tng_sdk-2.10.0-py3-none-manylinux_2_17_x86_64.whl
| Download URL | tng_sdk-2.10.0-py3-none-manylinux_2_17_x86_64.whl |
|---|---|
| Size | 34.9 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
c44a910a8d9a5eda13f8f3338c04ae985d7229159e0d8e67301cc97a090ee4fe
|
|
BLAKE2b-256 checksum How to use checksums |
ee4e5334866371ec198987b696bf10e6dbedb5dc7e7b75500f72383a98048335
|
| 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 23, 2026.
Transparency logRelease files / tng_sdk-2.10.0-py3-none-manylinux_2_17_aarch64.whl
| Download URL | tng_sdk-2.10.0-py3-none-manylinux_2_17_aarch64.whl |
|---|---|
| Size | 32.9 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
759b7a0f0bd633f2b00898033e7c755c164699c57dcc32f5f4f383f6f103a12e
|
|
BLAKE2b-256 checksum How to use checksums |
1f4d7dae86e03ef9153c13a89ffd9528ff29bda870c99c626009da1b76afe490
|
| 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 23, 2026.
Transparency logRelease files / tng_sdk-2.10.0-py3-none-macosx_11_0_x86_64.whl
| Download URL | tng_sdk-2.10.0-py3-none-macosx_11_0_x86_64.whl |
|---|---|
| Size | 38.3 MB |
| Tags | Python 3 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
6336ffa319cb3a8fd830219aa86d807d7fca0e90ac804b37f80bd1af28d0aa3f
|
|
BLAKE2b-256 checksum How to use checksums |
eec355c5ebb08b0b10f3a1270484746714aa02e10c11c911b43f30d2cb3d0426
|
| 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 23, 2026.
Transparency logRelease files / tng_sdk-2.10.0-py3-none-macosx_11_0_arm64.whl
| Download URL | tng_sdk-2.10.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 36.7 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fffe5882ad186f34f63eaa5ca19d358fac74f0b46c77c9a2bb80601643ace3e5
|
|
BLAKE2b-256 checksum How to use checksums |
43996f2d919cbeb1a667e708c67c79e8fdd8c50123057aa401b6e1e76514d00b
|
| 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 23, 2026.
Transparency log