Skip to content

singer-io/tap-pepperjam

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

tap-pepperjam

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

This tap:

Streams

Standard Endpoints:

creative_advanced

  • Endpoint: creative/advanced
  • Primary key fields: id
  • Replication strategy: INCREMENTAL (results filtered)
    • Bookmark: modified (date-time)
  • Transformations: none

creative_banner

  • Endpoint: creative/banner
  • Primary key fields: id
  • Replication strategy: INCREMENTAL (results filtered)
    • Bookmark: modified (date-time)
  • Transformations: none

creative_coupon

  • Endpoint: creative/coupon
  • Primary key fields: id
  • Replication strategy: INCREMENTAL (results filtered)
    • Bookmark: modified (date-time)
  • Transformations: none

creative_generic

  • Endpoint: creative/generic
  • Primary key fields: type
  • Replication strategy: INCREMENTAL (results filtered)
    • Bookmark: modified (date-time)
  • Transformations: none

creative_product

  • Endpoint: creative/product
  • Primary key fields: type
  • Replication strategy: FULL_TABLE
  • Transformations: none

crative_promotion

  • Endpoint: creative/promotion
  • Primary key fields: id
  • Replication strategy: FULL_TABLE
  • Transformations: none

creative_text

  • Endpoint: creative/text
  • Primary key fields: id
  • Replication strategy: INCREMENTAL (results filtered)
    • Bookmark: modified (date-time)
  • Transformations: none

group

  • Endpoint: group
  • Primary key fields: id
  • Replication strategy: FULL_TABLE
  • Transformations: none

group_member

  • Endpoint: group/member
  • Primary key fields: id
  • Replication strategy: FULL_TABLE for each groupId
  • Transformations: Add parent group_id

itemized_list

  • Endpoint: itemized-list
  • Primary key fields: id
  • Replication strategy: FULL_TABLE
  • Transformations: none

itemized_list_product

  • Endpoint: itemized-list/product
  • Primary key fields: id
  • Replication strategy: FULL_TABLE for each listId
  • Transformations: none

publisher

  • Endpoint: publisher
  • Primary key fields: id
  • Replication strategy: FULL_TABLE for status = joined
  • Transformations: none

itemized_list

  • Endpoint: itemized-list
  • Primary key fields: id
  • Replication strategy: FULL_TABLE
  • Transformations: none

term

  • Endpoint: term
  • Primary key fields: id
  • Replication strategy: FULL_TABLE
  • Transformations: none

Report Endpoints

creative_performance

  • Endpoint: report/creative-details-publisher
  • Primary key fields: creative_id, creative_type, date
  • Group by: date
  • Replication strategy: INCREMENTAL (query filtered)
    • Bookmark query fields: startDate, endDate
    • Bookmark: datetime (date-time)
  • Transformations: none

creative_performance_by_publisher

  • Endpoint: report/creative-details-publisher
  • Primary key fields: creative_id, creative_type, publisher_id, date
  • Group by: publisher_date
  • Replication strategy: INCREMENTAL (query filtered)
    • Bookmark query fields: startDate, endDate
    • Bookmark: datetime (date-time)
  • Transformations: none

publisher_performance

  • Endpoint: report/demand-details
  • Primary key fields: publisher_id, order_id, sale_date
  • Group by: publisher_date
  • Replication strategy: INCREMENTAL (query filtered)
    • Bookmark query fields: startDate, endDate
    • Bookmark: sale_date (date-time)
  • Transformations: none

transaction_details

  • Endpoint: report/transaction-details
  • Primary key fields: transaction_id
  • Replication strategy: INCREMENTAL (query filtered)
    • Bookmark query fields: startDate, endDate
    • Bookmark: sale_date (date-time)
  • Transformations: none

transaction_history

  • Endpoint: report/transaction-history
  • Primary key fields: transaction_id, item_id, revision
  • Replication strategy: INCREMENTAL (query filtered)
    • Bookmark query fields: startDate, endDate
    • Bookmark: sale_date (date-time)
  • Transformations: none

Authentication

Generate Advertiser API Key: The API requires an API Key for Pepperjam to authenticate you as a user. This key is required as a query parameter for all API requests. Login to Pepperjam’s Ascend Console UI. Navigate to https://ascend.pepperjam.com/merchant/api/. Select Generate New Key.

Quick Start

  1. Install

    Clone this repository, and then install using setup.py. We recommend using a virtualenv:

    > virtualenv -p python3 venv
    > source venv/bin/activate
    > python setup.py install
    OR
    > cd .../tap-pepperjam
    > pip install .
  2. Dependent libraries The following dependent libraries were installed.

    > pip install singer-python
    > pip install singer-tools
    > pip install target-stitch
    > pip install target-json
    
  3. Create your tap's config.json file. The api_key is available in the Pepperjam Console UI (see Authentication above). The date_window_days is the integer number of days (between the from and to dates) for date-windowing through the date-filtered endpoints (default = 30). The lock_period_days is the latency look-back period for reports/performance endpoints. The start_date is the absolute beginning date from which incremental loading on the initial load will start.

    {
        "api_key": "YOUR_API_KEY",
        "date_window_days": "30",
        "lock_period_days": "60",
        "start_date": "2019-01-01T00:00:00Z",
        "user_agent": "tap-pepperjam <api_user_email@your_company.com>",
    }

    Optionally, also create a state.json file. currently_syncing is an optional attribute used for identifying the last object to be synced in case the job is interrupted mid-stream. The next run would begin where the last job left off.

    {
        "currently_syncing": "registers",
        "bookmarks": {
            "transaction_details": "2020-03-23T10:31:14.000000Z",
            "creative_performance_by_publisher": "2020-03-23T00:00:00.000000Z",
            "transaction_history": "2020-03-23T10:31:14.000000Z",
            "creative_performance": "2020-03-23T00:00:00.000000Z",
            "publisher_performance": "2020-03-23T00:00:00.000000Z"
        }
    }
  4. Run the Tap in Discovery Mode This creates a catalog.json for selecting objects/fields to integrate:

    tap-pepperjam --config config.json --discover > catalog.json

    See the Singer docs on discovery mode here.

  5. Run the Tap in Sync Mode (with catalog) and write out to state file

    For Sync mode:

    > tap-pepperjam --config tap_config.json --catalog catalog.json > state.json
    > tail -1 state.json > state.json.tmp && mv state.json.tmp state.json

    To load to json files to verify outputs:

    > tap-pepperjam --config tap_config.json --catalog catalog.json | target-json > state.json
    > tail -1 state.json > state.json.tmp && mv state.json.tmp state.json

    To pseudo-load to Stitch Import API with dry run:

    > tap-pepperjam --config tap_config.json --catalog catalog.json | target-stitch --config target_config.json --dry-run > state.json
    > tail -1 state.json > state.json.tmp && mv state.json.tmp state.json
  6. Test the Tap

    While developing the pepperjam tap, the following utilities were run in accordance with Singer.io best practices: Pylint to improve code quality:

    > pylint tap_pepperjam -d missing-docstring -d logging-format-interpolation -d too-many-locals -d too-many-arguments

    Pylint test resulted in the following score:

    Your code has been rated at 9.70/10

    To check the tap and verify working:

    > tap-pepperjam --config tap_config.json --catalog catalog.json | singer-check-tap > state.json
    > tail -1 state.json > state.json.tmp && mv state.json.tmp state.json

    Check tap resulted in the following:

        The output is valid.
        It contained 62636 messages for 18 streams.
    
            18 schema messages
        62505 record messages
            62 state messages
    
        Details by stream:
        +-----------------------------------+---------+---------+
        | stream                            | records | schemas |
        +-----------------------------------+---------+---------+
        | creative_generic                  | 1       | 1       |
        | itemized_list_product             | 2       | 1       |
        | group                             | 19      | 1       |
        | creative_advanced                 | 6       | 1       |
        | creative_coupon                   | 24      | 1       |
        | creative_text                     | 46      | 1       |
        | term                              | 171     | 1       |
        | publisher_performance             | 2786    | 1       |
        | creative_product                  | 2       | 1       |
        | publisher                         | 63      | 1       |
        | creative_banner                   | 24      | 1       |
        | creative_performance_by_publisher | 5962    | 1       |
        | transaction_history               | 23654   | 1       |
        | creative_performance              | 5962    | 1       |
        | transaction_details               | 23654   | 1       |
        | itemized_list                     | 34      | 1       |
        | group_member                      | 67      | 1       |
        | creative_promotion                | 28      | 1       |
        +-----------------------------------+---------+---------+
    

Copyright © 2020 Stitch

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages