Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

TrustComponent SDK for Python

The official SDK for the TrustComponent API: TrustCaptcha, TrustAnalytics, TrustMonitoring, Trust VAT Checker and the platform API, in one package. Developed and hosted in the EU.

Requires Python 3.9 or newer.

Install

pip install trustcomponent

Check a TrustCaptcha result

The widget writes a verification token into your form. One call turns it into the result:

from trustcomponent import TrustComponent

tc = TrustComponent("ak_…")
result = tc.captcha.get_verification_result(request.form["tc-verification-token"])
if result.verification_passed:
    ...

Create the API key (ak_…) in the dashboard under the project's API keys. The key decides which modules the client can use.

Every module

The client is module → resource → operation, with the same names in every language:

from trustcomponent import models

tc.analytics.websites.get_websites()
tc.tax_validation.validations.create_validation(models.TaxValidationValidationCreateParams(countryCode="DE", rawValue="DE811569869"))
tc.monitoring.heartbeats.ping_heartbeat(service_id, monitor_id)
tc.platform.events.get_events()

The full reference of every operation is at https://docs.trustcomponent.com.

Configuration

tc = TrustComponent("ak_…", timeout=5, max_retries=1, integration="my-plugin/1.0")

Options: host, timeout, proxy, max_retries, deprecation_warnings, integration, logger.

The SDK retries only what the API reserves for retries: 429 with Retry-After, 502, 503, 504 and a lost connection (2 retries by default). When the API marks an operation as deprecated, it logs one warning per operation. Every request names the SDK in User-Agent and TrustComponent-Sdk, together with the integration you set.

Errors

Every error is a trustcomponent.TrustComponentError carrying the HTTP status and the stable code of the API: InvalidRequestError, AuthenticationError, PermissionDeniedError, PlanLimitError, NotFoundError, ConflictError, GoneError, RateLimitError, ServerError, ConnectionError, OperationRetiredError, VerificationTokenInvalidError.

from trustcomponent import NotFoundError

try:
    tc.captcha.get_verification_result(token)
except NotFoundError as e:
    print(e.status, e.code)

OperationRetired means the operation was switched off after its sunset: update the SDK.

Support

The GitHub repository of this SDK is a read-only mirror, generated from the TrustComponent API, so pull requests and issues are not processed there. For questions and bug reports, write to mail@trustcomponent.com or contact support through https://www.trustcomponent.com.

License

MIT

Metadata

Release files for trustcomponent 0.0.1b0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trustcomponent 0.0.1b0
File Size Uploaded Provenance Actions
trustcomponent-0.0.1b0.tar.gz 59.3 kB Without provenance Details for trustcomponent-0.0.1b0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for trustcomponent 0.0.1b0
File Interpreter ABI Platform Actions
trustcomponent-0.0.1b0-py3-none-any.whl Python 3 none any Details for trustcomponent-0.0.1b0-py3-none-any.whl

Total release size: 205.9 kB

Release files / trustcomponent-0.0.1b0.tar.gz

Download URL trustcomponent-0.0.1b0.tar.gz
Size 59.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1288be82b5035547c397ccb5c91f5afd11d099c30241a06380eea502b3f8e6a7
BLAKE2b-256 checksum
How to use checksums
cc26a4b379663af47e7b7b1c1712d79a4d35e34a2f082f6b9599e1d04a68e9f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / trustcomponent-0.0.1b0-py3-none-any.whl

Download URL trustcomponent-0.0.1b0-py3-none-any.whl
Size 146.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f093ca7e5d1c1333637b161d8637d02fedfc4b494872e6ae5e2960b515e5228
BLAKE2b-256 checksum
How to use checksums
c5b8811623d899d9a301294ca46b8e101956c898b59441fbaddcd03b0c451179
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for trustcomponent 0.0.1b0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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