Skip to content

singer-io/tap-teamwork

Repository files navigation

tap-teamwork

This is a Singer tap that produces JSON-formatted data following the [Singer spec](https://github.com/singer-io/getting-started/blob/master/docs/SPEC.md

This tap:

  • Pulls raw data from the [teamwork API].
  • Extracts the following resources:

Collaborators

Companies

CompanyDetails

Customers

CustomerDetails

Inboxes

Milestones

Notebooks

Pages

Projects

Spaces

Tags

Tasks

TicketDetails

TicketPriorities

Tickets

TicketSearch

TicketTypes

Users

  • Outputs the schema for each resource
  • Incrementally pulls data based on the input state

Streams

collaborators

  • Data Key: collaborators
  • Primary keys: ['id']
  • Replication strategy: FULL_TABLE

companies

  • Data Key: companies
  • Primary keys: ['id']
  • Replication strategy: INCREMENTAL

company_details

  • Data Key: company
  • Primary keys: ['id']
  • Replication strategy: FULL_TABLE

customers

  • Data Key: customers
  • Primary keys: ['id']
  • Replication strategy: FULL_TABLE

customer_details

  • Data Key: customer
  • Primary keys: ['id']
  • Replication strategy: FULL_TABLE

inboxes

  • Data Key: inboxes
  • Primary keys: ['id']
  • Replication strategy: INCREMENTAL

milestones

  • Data Key: milestones
  • Primary keys: ['id']
  • Replication strategy: INCREMENTAL

notebooks

  • Data Key: notebooks
  • Primary keys: ['id']
  • Replication strategy: INCREMENTAL

pages

  • Data Key: pages
  • Primary keys: ['id']
  • Replication strategy: FULL_TABLE

projects

  • Data Key: projects
  • Primary keys: ['id']
  • Replication strategy: INCREMENTAL

spaces

  • Data Key: spaces
  • Primary keys: ['id']
  • Replication strategy: INCREMENTAL

tags

  • Data Key: tags
  • Primary keys: ['id']
  • Replication strategy: FULL_TABLE

tasks

  • Data Key: tasks
  • Primary keys: ['id']
  • Replication strategy: INCREMENTAL

ticket_details

  • Data Key: ticket
  • Primary keys: ['id']
  • Replication strategy: FULL_TABLE

ticket_priorities

  • Data Key: priorities
  • Primary keys: ['id']
  • Replication strategy: INCREMENTAL

ticket_search

  • Data Key: tickets
  • Primary keys: ['id']
  • Replication strategy: INCREMENTAL

ticket_types

  • Data Key: types
  • Primary keys: ['id']
  • Replication strategy: INCREMENTAL

tickets

  • Data Key: tickets
  • Primary keys: ['id']
  • Replication strategy: INCREMENTAL

users

  • Data Key: users
  • Primary keys: ['id']
  • Replication strategy: INCREMENTAL

Authentication

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-teamwork
    > pip install -e .
  2. Dependent libraries. The following dependent libraries were installed.

    > pip install singer-python
    > pip install target-stitch
    > pip install target-json
    
  3. Create your tap's config.json file. The tap config file for this tap should include these entries:

    • start_date - the default value to use if no bookmark exists for an endpoint (rfc3339 date string)
    • api_key (string, required): Authentication key required for API access.
    • subdomain Required for building the api url.
    {
        "start_date": "2019-01-01T00:00:00Z",
        "api_key": "Dummy_API_KEY",
        "subdomain": "Domain",
    }```
    
    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.
    
    ```json
    {
        "currently_syncing": "pages",
        "bookmarks": {
            "projects": "2019-09-27T22:34:39.000000Z",
            "spaces": "2019-09-28T15:30:26.000000Z",
            "tags": "2019-09-28T18:23:53Z"
        }
    }
  4. Run the Tap in Discovery Mode This creates a catalog.json for selecting objects/fields to integrate:

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

    See the Singer docs on discovery mode [here](https://github.com/singer-io/getting-started/blob/master/docs/DISCOVERY_MODE.md

  5. Run the Tap in Sync Mode (with catalog) and [write out to state file](https://github.com/singer-io/getting-started/blob/master/docs/RUNNING_AND_DEVELOPING.md

    For Sync mode:

    > tap-teamwork --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-teamwork --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-teamwork --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 teamwork tap, the following utilities were run in accordance with Singer.io best practices: Pylint to improve [code quality](https://github.com/singer-io/getting-started/blob/master/docs/BEST_PRACTICES.md

    > pylint tap_teamwork -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.67/10

    To [check the tap](https://github.com/singer-io/singer-tools

    > tap_teamwork --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

    Unit Tests

    Unit tests may be run with the following.

    python -m pytest --verbose
    

    Note, you may need to install test dependencies.

    pip install -e .'[dev]'
    

Copyright © 2019 Stitch

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 9

Languages