GithubHelp home page GithubHelp logo

tap-ordway's Introduction

tap-ordway

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

This tap:

  • Pulls raw data from OrdwayLabs
  • Extracts the following resources:
    • billing_runs
    • billing_schedules
    • charges
    • chart_of_accounts
    • contacts
    • coupons
    • credits
    • customer_notes
    • customers
    • invoices
    • orders
    • payment_methods
    • payment_runs
    • payments
    • plans
    • products
    • refunds
    • revenue_rules
    • revenue_schedules
    • statements
    • subscriptions
    • usages
    • webhooks
  • Outputs the schema for each resource
  • Incrementally pulls data based on the input state

Installation

Requirements

  • Python 3.6+
  • mkvirtualenv
  • pip

Steps

Run following commands on terminal from the project directory

python3 -m venv ~/.virtualenvs/tap-ordway
source ~/.virtualenvs/tap-ordway/bin/activate
pip install -e .

To Run

$ source ~/.virtualenvs/tap-ordway/bin/activate

$ tap-ordway -c config.json --catalog catalog.json -s state.json

You can generate the catalog.json by following command:

$ tap-ordway -c config.json --discover > catalog.json

The sample config JSON is format is given below:

{
"company": "Rocky",
"user_email": "[email protected]",
"user_token": "123usertoken",
"api_key": "123secret",
"start_date": "2019-12-01"
}

The start_date indicates the data at which the tap should start syncing data when no bookmark exists in the state for that particular stream.

The following configuration keys are optional:

  • staging - Whether or not to use the staging environment (staging.ordwaylabs.com)
  • api_version - Which Ordwaylabs API version to use (e.g. "v1")
  • api_url - An alternative URL to which the API requests will be made (e.g. "https://localhost:3000/v1/"). When specified, it will take precendence over staging and api_version.
  • rate_limit_rps - The amount of requests to allow per second (defaults to null, disabling rate limiting)

The State JSON should be passed by user. The Tap will be printing the STATE message, the last state message should send when running next time.

Sample JSON:

{
"currently_syncing": "credits",
"bookmarks": {
"credits": {
"updated_date": "2020-11-14T05:59:48.842000Z"
}
}
}

Testing

  1. Install the dev extra requirements
pip install .[dev]
  1. Execute tox with the default environments: py36, py37, py38, and type (for static type checking via mypy)
tox

Additionally, you can generate a Coverage report by using the coverage environment:

tox -e coverage

For more information on tox, please refer to its documentation.

Testing with singer-check-tap

singer-check-tap is a tool for testing whether or not a tap adheres to the Singer specification. For more information, please review its documentation.

  1. Install the singer-tools package
pip install singer-tools
  1. Execute singer-check-tap
singer-check-tap --tap tap-ordway --config config.json

In this mode, singer-check-tap will execute the tap itself, run it in discover mode to generate a catalog, perform a stateless run and a stateful run, and validate the tap's output.

If you need to test with a modified catalog, you can do so by piping the tap's output directly into singer-check-tap like so:

tap-ordway --config config.json --catalog catalog.json | singer-check-tap

Copyright © 2020 Stitch

tap-ordway's People

Contributors

luandy64 avatar mubarakrocky avatar zachharris1 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.