Skip to main content

HubSpot Python connector

This package implements HubSpot CRM search, get, upsert, and update operations for Dex Python Flows and, from 0.2.0, the crmObjectChanged poll Trigger at parity with the Go connector. connector.yaml defines operation identities, typed Steps, and the private app and OAuth connection contracts. OAuth refresh and shared credential handling are generated from the manifest.

Use new_project_connection(project, "hubspot-crm") to bind the connection configured in Dex Web. The runnable Flow in examples/read_contact demonstrates the connection and operation-specific Step factory.

Run uv sync --locked, uv run pytest, uv run ruff check ., and uv run mypy src tests examples from this directory. The package requires dex-connectors-sdk 0.12.0 or newer, the first release with the poll Trigger kit. The conformance suite replays Go-recorded HubSpot responses without a real account. With dexcli dev listening on port 44400, run DEX_FLOW_SERVICE_ADDRESS=127.0.0.1:44400 uv run pytest examples/read_contact/integration_test.py to verify the Flow through a real Dex Worker and Client; examples/crm_object_changed/integration_test.py runs the same way. Live HubSpot authorization and provider behavior require a user-controlled Dex Web connection and remain unverified.

crmObjectChanged Trigger

crmObjectChanged polls one object type, contacts, companies, or deals, through HubSpot CRM search and delivers one CRMObjectChangedEvent per created or changed record: object_type, change_kind (created or updated), modified_at, and the object as search returned it. It is built on dex_connectors.sdk.pollingtrigger and follows the Go connector exactly: the first poll records the newest last-modified date as a baseline and delivers no existing record; later polls search ascending on lastmodifieddate (contacts) or hs_lastmodifieddate, 100 records per page, re-read a two-minute lag window for late-indexed records, and skip versions already delivered. A 429 or 423 pauses every binding of the connection for Retry-After or X-HubSpot-RateLimit-Interval-Milliseconds, an exhausted daily limit backs off up to 15 minutes, and a rejected paging offset or unusable cursor records a new baseline with a WARN record. The connection's pollInterval (Go nanoseconds in project configuration; at least 5 seconds, 30 by default) sets the delay between polls. The connector README describes the behavior in full.

The cursor document is the Go connector's JSON byte for byte, and the event ID is the same hash of object type, record ID, and last-modified millisecond, so Go and Python replicas can share one binding's cursor and inbox. tests/test_crm_object_change_fetcher.py replays a scenario recorded from the Go fetcher (tests/fixtures/go-crm-object-change-cursors.json), compares every cursor token and event ID, and decodes the Go-recorded payloads with decode_crm_object_changed_event_payload.

await new_project_crm_object_trigger_runner(project, connection_name, routes, http_client, logger) is the durable path: it loads each binding's saved object type, records every change in the binding's project Trigger inbox, and commits the search position in its project poll cursor only after that. Run it with run(TriggerContext(cancellation)), wake a binding with wake_poller, and close it with aclose. From examples/crm_object_changed/watcher.py:

runner = await new_project_crm_object_trigger_runner(
    project,
    CONNECTION_NAME,
    [
        ProjectCRMObjectChangedTriggerRoute(
            CRM_OBJECT_CHANGED_TRIGGER_BINDING, target, DELIVERED_PROPERTIES
        )
    ],
    http_client,
    logger,
)

new_crm_object_trigger_runner(connection, routes) takes targets and cursor stores directly, and new_crm_object_changed_trigger builds one binding for new_trigger; both keep the cursor in memory unless given a store, so a restart records a new baseline. A Flow declares its static binding with define_crm_object_changed_trigger_binding in get_connector_trigger_bindings, whose body is a single return [...] statement. decode_crm_object_changed_trigger_configuration and validate_crm_object_changed_trigger_configuration apply the Go connector's strict decoding and validation.

Dex CLI 1.47.3 reads the binding from the example Flow but warns connector_configuration_ui: Connector ConfigurationUI must be a static literal for the objectTypePicker unit, because its Python analyzer accepts only a dictionary literal while define_crm_object_changed_trigger_binding requires a ConnectorConfigurationUI. Until the analyzer reads the dataclass form, Dex Web may show the binding without the Watched object type picker; save objectType in the binding configuration directly or from a Go or TypeScript Flow's binding.

The crm_object_changed example starts one Flow per change. Live HubSpot search has not been verified.

Metadata

Release files for dex-connector-hubspot 0.2.0

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-hubspot 0.2.0
File Size Uploaded Provenance Actions
dex_connector_hubspot-0.2.0.tar.gz 128.6 kB Without provenance Details for dex_connector_hubspot-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 173.9 kB

Release files / dex_connector_hubspot-0.2.0.tar.gz

Download URL dex_connector_hubspot-0.2.0.tar.gz
Size 128.6 kB
Tags Source
SHA-256 checksum
How to use checksums
836549f732b8ca1df4bf8d50bd2332285b97e843a36d9910d35716914991ff7f
BLAKE2b-256 checksum
How to use checksums
456a68be78eaa992b0378fbfc94fb932cb467720c953c3f333326c0e470444d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","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_hubspot-0.2.0-py3-none-any.whl

Download URL dex_connector_hubspot-0.2.0-py3-none-any.whl
Size 45.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb92edee1ccdd14c65dc95eb1492530a8b44c238177635cba8ccdc0877fc46c6
BLAKE2b-256 checksum
How to use checksums
052d2ca07b5cf21c1a53c0d28b06cc3ec6293400e826f5dde1e7708860eee980
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","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-hubspot 0.2.0

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