Official Tripwire Python server SDK
Project description
Tripwire Python Library
The Tripwire Python library provides convenient access to the Tripwire API from applications written in Python. It includes a synchronous client for Sessions, Fingerprints, Teams, Team API key management, and sealed token verification.
The library also provides:
- a fast configuration path using
TRIPWIRE_SECRET_KEY - iterator helpers for cursor-based pagination
- structured API errors and built-in sealed token verification
Documentation
See the Tripwire docs and API reference.
Installation
You don't need this source code unless you want to modify the package. If you just want to use the package, run:
pip install tripwire-server
Requirements
- Python 3.10+
Usage
The library needs to be configured with your account's secret key. Set TRIPWIRE_SECRET_KEY in your environment or pass secret_key directly:
from tripwire_server import Tripwire
client = Tripwire(secret_key="sk_live_...")
page = client.sessions.list(verdict="bot", limit=25)
session = client.sessions.get("sid_123")
Sealed token verification
from tripwire_server import safe_verify_tripwire_token
result = safe_verify_tripwire_token(
sealed_token,
"sk_live_...",
)
if result.ok:
print(result.data.verdict, result.data.score)
else:
print(result.error)
Pagination
for session in client.sessions.iter(search="signup"):
print(session.id, session.latest_result.verdict)
Fingerprints
page = client.fingerprints.list(sort="seen_count")
fingerprint = client.fingerprints.get("vis_123")
Teams
team = client.teams.get("team_123")
updated = client.teams.update("team_123", name="New Name")
Team API keys
created = client.teams.api_keys.create(
"team_123",
name="Production",
allowed_origins=["https://example.com"],
)
client.teams.api_keys.revoke("team_123", created.id)
Error handling
from tripwire_server import TripwireApiError
try:
client.sessions.list(limit=999)
except TripwireApiError as error:
print(error.status, error.code, error.message)
Support
If you need help integrating Tripwire, start with tripwirejs.com/docs.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tripwire_server-0.1.1.tar.gz.
File metadata
- Download URL: tripwire_server-0.1.1.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57477dd378a386837dc0bad519acf402e140e95bd6dec54bae49aaa119a9665c
|
|
| MD5 |
a1071bdbdb59ea4c356ef7f595f348b0
|
|
| BLAKE2b-256 |
ea4f5bcc7dea008df1eb2d56e9631f9075225b5b8d65ea3895485eabcb03acd1
|
Provenance
The following attestation bundles were made for tripwire_server-0.1.1.tar.gz:
Publisher:
release.yml on abxy-labs/tripwire-server-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tripwire_server-0.1.1.tar.gz -
Subject digest:
57477dd378a386837dc0bad519acf402e140e95bd6dec54bae49aaa119a9665c - Sigstore transparency entry: 1181871430
- Sigstore integration time:
-
Permalink:
abxy-labs/tripwire-server-python@6703b2370c7b8b888459d88232396a23eb88e28d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/abxy-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6703b2370c7b8b888459d88232396a23eb88e28d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file tripwire_server-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tripwire_server-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aaaebe00b859e11aff9e6716eb067044428789fd68a2d9f278e0defc43d6792a
|
|
| MD5 |
2a6f9abd627473b4ee3730b16fc8398f
|
|
| BLAKE2b-256 |
5e256255b8e19da1c6f1dff9384620ac4f39b91b3d3d3537752e8a5cf238e748
|
Provenance
The following attestation bundles were made for tripwire_server-0.1.1-py3-none-any.whl:
Publisher:
release.yml on abxy-labs/tripwire-server-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tripwire_server-0.1.1-py3-none-any.whl -
Subject digest:
aaaebe00b859e11aff9e6716eb067044428789fd68a2d9f278e0defc43d6792a - Sigstore transparency entry: 1181871442
- Sigstore integration time:
-
Permalink:
abxy-labs/tripwire-server-python@6703b2370c7b8b888459d88232396a23eb88e28d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/abxy-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6703b2370c7b8b888459d88232396a23eb88e28d -
Trigger Event:
workflow_dispatch
-
Statement type: