Giter VIP home page Giter VIP logo

tap-toggl's Introduction

tap-toggl

Tap for Toggl.

Requirements

  • pip3
  • python 3.5+
  • mkvirtualenv

Installation

In the directory:

$ mkvirtualenv -p python3 tap-toggl
$ pip3 install -e .

Usage

Create config file

This config is to authenticate into toggl. You can request an API token in your settings on the Toggl website.

The detailed_report_trailing_days determines the window of how many trailing days to pull the time_entries resource.

{
  "api_token": "*****",
  "detailed_report_trailing_days": 1
}

Discovery mode

This command returns a JSON that describes the schema of each table.

$ tap-toggl --config config.json --discover

To save this to catalog.json:

$ tap-toggl --config config.json --discover > catalog.json

Field selection

You can tell the tap to extract specific fields by editing catalog.json to make selections. Note the top-level selected attribute, as well as the selected attribute nested under each property.

{
  "selected": "true",
  "properties": {
    "likes_getting_petted": {
      "selected": "true",
      "inclusion": "available",
      "type": [
        "null",
        "boolean"
      ]
    },
    "name": {
      "selected": "true",
      "maxLength": 255,
      "inclusion": "available",
      "type": [
        "null",
        "string"
      ]
    },
    "id": {
      "selected": "true",
      "minimum": -2147483648,
      "inclusion": "automatic",
      "maximum": 2147483647,
      "type": [
        "null",
        "integer"
      ]
    }
  },
  "type": "object"
}

Sync Mode

With an annotated catalog.json, the tap can be invoked in sync mode:

$ tap-toggl --config config.json --catalog catalog.json

Messages are written to standard output following the Singer specification. The resultant stream of JSON data can be consumed by a Singer target.

Replication Methods and State File

Incremental

The streams that are incremental are:

  • workspaces
  • clients
  • groups
  • projects
  • tasks
  • users
  • workspace_users
  • time entries*

Time entries uses a lookback window set by the config's "detailed_report_trailing_days" to pull data, then uses replication key updated as the bookmark.

Full Table

The only stream that is full table is tags.

Tests

$ make test

Copyright © 2018 Stitch

tap-toggl's People

Contributors

lambtron avatar kallan357 avatar luandy64 avatar nick-mccoy avatar dmosorast avatar

Stargazers

Leah Willis avatar Eray Bartan avatar Nicholas Ramsey avatar Al Whatmough avatar Lui Pillmann avatar Raphael Costa avatar

Watchers

 avatar James Cloos avatar Bryant Gray avatar Chris Capurso avatar Matthew Bilyeu avatar Akshay Mhetre avatar Arthur Gorka avatar Collin Simon avatar Shantanu Dhiman avatar  avatar  avatar  avatar  avatar  avatar  avatar

tap-toggl's Issues

Migrate to Toggl V9 api

Toggl released a new version of their API, and therefore plans to deprecate the V8 version (which is the one currently used by this tap).
This tap should accordingly migrate to the new API endpoints, and update the schema files with the updated fields.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.