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.1b1

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.1b1
File Size Uploaded Provenance Actions
trustcomponent-0.0.1b1.tar.gz 59.3 kB Without provenance Details for trustcomponent-0.0.1b1.tar.gz

Built distribution (wheel)

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

Total release size: 205.9 kB

Release files / trustcomponent-0.0.1b1.tar.gz

Download URL trustcomponent-0.0.1b1.tar.gz
Size 59.3 kB
Tags Source
SHA-256 checksum
How to use checksums
28184b0e8c5d1c16bdf919404a330352afb25ecd4ebf0cbfc36d03093aae3216
BLAKE2b-256 checksum
How to use checksums
53e742ddeddd17b04ca92016b1158e33d938be0a7b61f32713334019a452f3f5
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.1b1-py3-none-any.whl

Download URL trustcomponent-0.0.1b1-py3-none-any.whl
Size 146.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55da8443da9fae4e262d8e8614bca1c8d237e8378032833c4a0b7547e6bfa0d3
BLAKE2b-256 checksum
How to use checksums
fe0531bca453ff17af34ccaa710c76f1085c5ad39f8dbcb240b9f794b8b32161
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.1b1

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