Skip to main content

Gorgias Python connector

dex-connector-gorgias v0.2.1 implements the six Gorgias ticket and customer operations declared in connector.yaml for Dex Python applications: search tickets, get a ticket, find a customer by email, create a ticket, update a ticket, and add an internal note or public email reply. It also implements the ticketChanged poll Trigger. It requires dex-connectors-sdk>=0.12.0, which adds the poll Trigger kit.

Use new_project_connection(project, "gorgias") to bind a Dex Web connection. The connection resolves the Gorgias email and API key on each provider call. new_connection accepts a configured Client for an application that supplies its own credential provider. Close an owned client after the Worker stops.

create_ticket and add_note send under the SDK single-dispatch fence with the manifest send cap of three: after an unknown outcome the next attempt reads the write back by its external ID, resends while the cap allows, and selects uncertain only at the cap, as the connector README describes. A 2xx is never resent, even when its body is unusable or breaks while it is read; it is read back once instead. Markers written by v0.2.0 are untrusted by the SDK fence, so a write in flight during the upgrade retries without sending until its retry budget runs out. update_ticket retries any outcome after a write that is not a definite refusal.

The runnable examples/triage_issue Flow exercises ticket search and detail lookup. For provider behavior, supply a connection through Dex Web and run the example against a real Gorgias account. The local integration test uses a provider stand-in and does not establish live provider authorization.

ticketChanged Trigger

ticketChanged delivers each Gorgias ticket event, such as ticket-created, ticket-updated, or ticket-closed, recorded after the binding first started, as a TicketChangedEvent with event_id, event_type, ticket_id, occurred_at, user_id (zero for a rule), and context. Each poll reads GET /api/events in created_datetime order. The behavior matches the Go connector, which the connector README describes in full: the first poll records a baseline at Gorgias's Date header and delivers nothing, each poll rereads a 15-second overlap and skips events it has seen, it reads at most five pages of 100 events per poll and stops paging when X-Gorgias-Account-Api-Call-Limit shows three quarters of the window spent, a 429 pauses the connection for Retry-After, a 400 backs off and retries from the same position, and only an undecodable cursor records a new baseline. Event IDs are gorgias-event-<id>, stable across refetches. The cursor token is byte-compatible with Go, and inbox payloads use the Go JSON fields, so Go and Python replicas can share one binding; tests/test_ticket_changed_go_parity.py replays a Go recording to prove it.

The connection's pollInterval setting, Config.poll_interval_seconds in code, is the delay between polls; Client rejects one under 10 seconds.

Function Use
new_project_ticket_trigger_runner(project, connection, config) Durable delivery from a LoadedProject: each route's saved binding configuration is loaded (an unsaved binding delivers every ticket event type), and each event is recorded in the binding's project Trigger inbox before its cursor commits.
new_ticket_trigger_runner(config) One PollRunner for TicketChangedTriggerRoute values with your own targets and cursor stores; a route without a cursor keeps it in memory.
new_ticket_changed_trigger(connection=, binding_name=, configuration=, target=) One in-memory TriggerRunner, like Go's generated NewTicketChangedTrigger; it records a new baseline on every start.
define_ticket_changed_trigger_binding(connection_name=, binding_name=) Declares the binding in a Flow's get_connector_trigger_bindings. Dex Web shows no field for it.

TicketChangedTriggerConfiguration.event_types narrows deliveries to some of TICKET_EVENT_TYPES; skipped events still advance the cursor. The ticket_changed example wires a Flow target in worker.py:

runner = new_project_ticket_trigger_runner(
    project,
    connection,
    ProjectTicketTriggerRunnerConfig(
        [ProjectTicketChangedTriggerRoute(BINDING_NAME, new_ticket_change_flow_target(dex_client, flow))]
    ),
)

PollRunner.run(TriggerContext(cancellation)) replays the inboxes, seeds, and polls until the cancellation fires, then raises TriggerDeliveryAbortedError. Live Gorgias polling has not been verified.

Tests

Run uv sync --group dev and uv run pytest tests from this directory. The conformance test replays the Go connector's recorded provider scenarios.

Metadata

Release files for dex-connector-gorgias 0.2.1

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

Source distribution (sdist)

Source distribution for dex-connector-gorgias 0.2.1
File Size Uploaded Provenance Actions
dex_connector_gorgias-0.2.1.tar.gz 159.7 kB Without provenance Details for dex_connector_gorgias-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dex-connector-gorgias 0.2.1
File Interpreter ABI Platform Actions
dex_connector_gorgias-0.2.1-py3-none-any.whl Python 3 none any Details for dex_connector_gorgias-0.2.1-py3-none-any.whl

Total release size: 223.9 kB

Release files / dex_connector_gorgias-0.2.1.tar.gz

Download URL dex_connector_gorgias-0.2.1.tar.gz
Size 159.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a46ca1499d36a94dd7a7dcdbd3bee9b8afd4ccfd66f93fc62218cf7cfa6f50f4
BLAKE2b-256 checksum
How to use checksums
bf1c2fbccbada4e8f9df9203d3ea5e0050336c4c263b4a0f31f8b0760f21472c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / dex_connector_gorgias-0.2.1-py3-none-any.whl

Download URL dex_connector_gorgias-0.2.1-py3-none-any.whl
Size 64.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3efa18acc1e4f7b9ef846c370aec9f156ef2c6e41c948c3e47312b24d5eea280
BLAKE2b-256 checksum
How to use checksums
bccf4105b213f288a415f53fd4ce7ebeaadf5e6789d3dc6fd629d7c483514639
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for dex-connector-gorgias 0.2.1

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