Skip to main content

Dagster library for Hightouch

Project description

dagster-hightouch

A Dagster library for triggering syncs in Hightouch.

Installation

To install the library, use pip alongside your existing Dagster environment.

pip install dagster-hightouch

Configuration

First, you'll need to specify your Hightouch API key as a resource.

# resources.py
from dagster_hightouch.resources import ht_resource as hightouch_resource

ht_resource = hightouch_resource.configured(
    {"api_key": "555555-4444-3333-2222-1111111111"},
)

Ops

The hightouch_sync_op will call the Hightouch API to trigger a sync and monitor it until it completes.

from dagster import ScheduleDefinition, get_dagster_logger, job
from dagster_hightouch.ops import hightouch_sync_op
from .resources import ht_resource

# Sync IDs are set as constants. You can also use
# the sync slug, read the documentation for other
# options.

HT_WS = "23620"
HT_ORG = "39619"

# We define two configured sync ops
run_ht_sync_workspaces = hightouch_sync_op.configured(
    {"sync_id": HT_WS}, name="hightouch_sfdc_workspaces"
)
run_ht_sync_orgs = hightouch_sync_op.configured(
    {"sync_id": HT_ORG}, name="hightouch_sfdc_organizations"
)

# And create a job with the defined resources, specifying the dependencies.
@job(
    resource_defs={
        "hightouch": ht_resource,
    }
)
def ht_sfdc_job():

    ht_orgs = run_ht_sync_orgs(start_after=ht_contacts)
    run_ht_sync_workspaces(start_after=ht_orgs)

# And we schedule it to run every 30 mins.
every_30_schedule = ScheduleDefinition(job=ht_sfdc_job, cron_schedule="*/30 * * * *")

Components (Modern)

You can now use Hightouch as a Dagster Component. This allows you to define syncs in YAML.

# code/component.yaml
type: HightouchSyncComponent
attributes:
  sync_id: "12345"
  asset:
    key: ["hightouch", "my_sync_asset"]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dagster_hightouch-0.1.8.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dagster_hightouch-0.1.8-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file dagster_hightouch-0.1.8.tar.gz.

File metadata

  • Download URL: dagster_hightouch-0.1.8.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for dagster_hightouch-0.1.8.tar.gz
Algorithm Hash digest
SHA256 abdeafaf95b44a97a290e2316564afdd6c4364dc8f1a0aa668a5ccfcd84f06bc
MD5 c39fd87d3d7edf1059cb7f26ff6ff688
BLAKE2b-256 8839c275be263c41c4bcdebad01248a54cb4089e91222702c20292ae33f36ead

See more details on using hashes here.

File details

Details for the file dagster_hightouch-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for dagster_hightouch-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b5eab711f4e94ad34fa8b300d719f7005f422e71567305ba94717c242868a607
MD5 8a540b7dafe89c01a5d43754f1ba271f
BLAKE2b-256 bfe6f92eaab6a9331bf4ce79b76ce691a57dabe02d82019498e4add516270953

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page