Skip to content

fixdauto/tap-dhl-ecommerce

Repository files navigation

tap-dhl-ecommerce

tap-dhl-ecommerce is a Singer tap for DHL eCommerce Americas.

Built with the Meltano Tap SDK for Singer Taps.

Features

  • Leverages the tracking endpoint from the DHL eCommerce Americas API in order to grab package tracking status updates.
  • Built with the Singer SDK for extensibility and Meltano compatibility.

Requirements

  • Python 3.9+

  • DHL eCommerce Americas Client ID & Secret

  • Singer SDK

  • Meltano (optional, for pipeline orchestration)

Installation

  1. Clone the repository:
git clone https://github.com/fixdauto/tap-dhl-ecommerce.git
cd tap-dhl-ecommerce
  1. Install the dependencies:
poetry install
  1. Activate the Poetry virtual environment:
poetry shell

Configuration

  1. Create a config.json file with the following structure:
{
  "pickup_id": "YOUR_DHL_ACCOUNT_PICKUP_ID",
  "client_id": "YOUR_DHL_CLIENT_ID",
  "client_secret": "YOUR_DHL_CLIENT_SECRET"
}
  • pickup_id: Your DHL eCommerce Americas account pickup ID.

  • client_id: Your DHL eCommerce Americas client ID.

  • client_secret: Your DHL eCommerce Americas client secret.

  1. Place config.json in the root directory or pass its path as an argument when running the tap.

Running the Tap

  1. Run the tap standalone:
poetry run python -m tap_dhl_ecommerce --config config.json
  1. Use with Meltano for pipeline orchestration:
  • Add the tap to your Meltano project:
meltano add extractor tap-dhl-ecommerce
  • Configure the tap in meltano.yml:
extractors:
  tap-dhl-ecommerce:
    config:
      pickup_id: YOUR_DHL_ACCOUNT_PICKUP_ID
      client_id: YOUR_DHL_CLIENT_ID
      client_secret: YOUR_DHL_CLIENT_SECRET
  • Run the tap via Meltano:
meltano run tap-dhl-ecommerce target-your-target

Accepted Config Options

A full list of supported settings and capabilities for this tap is available by running:

tap-dhl-ecommerce --about

Configure using environment variables

This Singer tap will automatically import any environment variables within the working directory's .env if the --config=ENV is provided, such that config values will be considered if a matching environment variable is set either in the terminal context or in the .env file.

Testing with Meltano

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

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

Now you can test and orchestrate using Meltano:

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

Customization

The streams.py file provides the main logic for fetching and processing data. Key points of customization include:

  • Date Range: Modify the date range being requested by changing the start_date variable in the get_records method.

  • Date Interval: This script defaults to requesting data day by day, but that can be adjusted by changing the interval_in_days parameter in the date_range method.

Development

  1. Install development dependencies using Poetry:
poetry install --with dev
  1. Run tests:
poery run pytest

SDK Dev Guide

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages