Giter Site home page Giter Site logo

singer-tap-template's Introduction

singer-tap-template

A cookiecutter template for creating Singer taps.

Usage

The best way to demonstrate creating your tap structure is with an example. Below I will initialize the "tap-foobar" project:

Start by installing cookiecutter:

$ pip install cookiecutter

The next command will ask for some input. Enter the name of your tap:

$ cookiecutter https://github.com/singer-io/singer-tap-template.git
project_name [e.g. 'tap-facebook']: tap-foobar

For the package_name, I just hit enter since tap_foobar is what I wanted:

package_name [tap_foobar]:

Now that the project exists, make a virtual environment:

$ cd tap-foobar
$ python3 -m venv ~/.virtualenvs/tap-foobar
$ source ~/.virtualenvs/tap-foobar/bin/activate

Install the package:

$ pip install -e .

And invoke the tap in discovery mode to get the catalog:

$ tap-foobar -c sample_config.json --discover

The output should be a catalog with the single sample stream (from the schemas folder):

{
  "streams": [
    {
      "metadata": [],
      "schema": {
        "additionalProperties": false,
        "properties": {
          "string_field": {
            "type": [
              "null",
              "string"
            ]
          },
          "datetime_field": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "double_field": {
            "type": [
              "null",
              "number"
            ]
          },
          "integer_field": {
            "type": [
              "null",
              "integer"
            ]
          }
        },
        "type": [
          "null",
          "object"
        ]
      },
      "stream": "sample_stream",
      "key_properties": [],
      "tap_stream_id": "sample_stream"
    }
  ]
}

If this catalog is saved to a catalog.json file, it can be passed back into the tap in sync mode:

tap-foobar -c sample_config.json --properties catalog.json

Now you build the tap!

Copyright © 2018 Stitch

singer-tap-template's People

Contributors

nick-mccoy avatar b-ryan avatar dmosorast avatar aaronsteers avatar

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.