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. From 0.2.1, upsertObject and updateObject declare repeatOnUnknown: safe and retry any HTTP status that does not prove a refusal, including a 409 without HubSpot's documented CONFLICT category; a documented 409 CONFLICT selects conflict for an update, and for an upsert after one resend. 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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dex_connector_hubspot-0.2.1.tar.gz | 131.2 kB | Without provenance | Details for dex_connector_hubspot-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dex_connector_hubspot-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for dex_connector_hubspot-0.2.1-py3-none-any.whl |
Total release size: 178.0 kB
Release files / dex_connector_hubspot-0.2.1.tar.gz
| Download URL | dex_connector_hubspot-0.2.1.tar.gz |
|---|---|
| Size | 131.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
189a037227a22a2a635c7c896740286db070397838da60a08af5d2393123d275
|
|
BLAKE2b-256 checksum How to use checksums |
def8c3aff3472e92c2b936f5ab6529ebab3607bf0a1e0f0ffc460d6eedaca1be
|
| 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_hubspot-0.2.1-py3-none-any.whl
| Download URL | dex_connector_hubspot-0.2.1-py3-none-any.whl |
|---|---|
| Size | 46.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
215939b86d972402ffeb00e26b2f948d436694d0ab386474195a3e4d63a503cc
|
|
BLAKE2b-256 checksum How to use checksums |
ce068e35fa2e20ef8693676b68306a65e1e81124ca944671ab74be9efba00b57
|
| 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-hubspot 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.