Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

potloc/tap-hubspot

Repository files navigation

tap-hubspot

tap-hubspot is a Singer tap for Hubspot.

Built with the Meltano Tap SDK for Singer Taps.

tap-hubspot

Hubspot tap class.

Built with the Meltano SDK for Singer Taps and Targets.

Capabilities

  • catalog
  • state
  • discover
  • about
  • stream-maps
  • schema-flattening

Settings

Setting Required Default Description
access_token True None PRIVATE Access Token for Hubspot API (TODO: Add public option)
start_date True None The earliest record date to sync
stream_maps False None Config object for stream maps capability.
stream_map_config False None User-defined config values to be used within map expressions.
flattening_enabled False None 'True' to enable schema flattening and automatically expand nested properties.
flattening_max_depth False None The max depth to flatten schemas.

A full list of supported settings and capabilities is available by running: tap-hubspot --about

Setup

This is a Singer tap that produces JSON-formatted data following the Singer spec.

This tap:

Configuration

This tap requires a config.json which specifies details regarding OAuth 2.0 authentication, a cutoff date for syncing historical data, and an optional flag which controls collection of anonymous usage metrics. See config.sample.json for an example. You may specify an API key instead of OAuth parameters for development purposes, as detailed below.

To run tap-hubspot with the configuration file, use this command:

› tap-hubspot -c my-config.json

API Key Authentication (for development)

As an alternative to OAuth 2.0 authentication during development, you may specify an API key (HAPIKEY) to authenticate with the HubSpot API. This should be used only for low-volume development work, as the HubSpot API Usage Guidelines specify that integrations should use OAuth for authentication.

To use an API key, include a hapikey configuration variable in your config.json and set it to the value of your HubSpot API key. Any OAuth authentication parameters in your config.json will be ignored if this key is present!


Copyright © 2017 Stitch

Usage

You can easily run tap-hubspot by itself or in a pipeline using Meltano.

Executing the Tap Directly

tap-hubspot --version
tap-hubspot --help
tap-hubspot --config CONFIG --discover > ./catalog.json

Initialize your Development Environment

pipx install poetry
poetry install

Create and Run Tests

Create tests within the tap_hubspot/tests subfolder and then run:

poetry run pytest

You can also test the tap-hubspot CLI interface directly using poetry run:

poetry run tap-hubspot --help

Testing with Meltano

Note: This tap will work in any Singer environment and does not require Meltano. Examples here are for convenience and to streamline end-to-end orchestration scenarios.

Your project comes with a custom meltano.yml project file already created. Open the meltano.yml and follow any "TODO" items listed in the file.

Next, install Meltano (if you haven't already) and any needed plugins:

# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd tap-hubspot
meltano install

Now you can test and orchestrate using Meltano:

# Test invocation:
meltano invoke tap-hubspot --version
# OR run a test `elt` pipeline:
meltano elt tap-hubspot target-jsonl

SDK Dev Guide

See the dev guide for more instructions on how to use the SDK to develop your own taps and targets.