This is a Singer tap that produces JSON-formatted data following the Singer spec.
This tap:
- Pulls raw data from Sling (API documentation here)
- Extracts the following resources:
- Shifts
- No Shows
- Leaves
- Leave Types
- Users
- Outputs the schema for each resource
- Incrementally pulls data based on the input state
api_key
must be provided in config and start_date
must be provided either in config or state.
shifts
, no_shows
, and leaves
are pulled from the provided start_date
through 1 day before run date. There is no benefit to running this tap more than daily.
leave_types
and users
are fully replicated on every run.
-
Get a Sling API key
Instructions here
-
Install
Clone this repo
git clone ...
We recommend using a virtualenv:
virtualenv -p python3 venv source venv/bin/activate pip3 install -e .
-
Set up your config file.
An example config file is provided in
sample_config.json
-
Run the tap in discovery mode to get catalog.json file.
tap-sling --config config.json --discover > catalog.json
-
In the generated
catalog.json
file, select the streams to sync.Each stream in the
catalog.json
file has aschema
entry. To select a stream to sync, add "selected": true to that stream'sschema
entry. For example, to sync theshifts
stream:"tap_stream_id": "shifts", "schema": { "selected": true, "properties": { ... } } ...
-
Run the application
tap-sling can be run with:
tap-sling --config config.json --catalog catalog.json
-
To run with Stitch Import API with dry run:
tap-sling --config config.json --catalog catalog.json | target-stitch --config target_config.json --dry-run > state.json
While developing the tap, run pylint to improve better code quality which is recommended by Singer.io best practices.
pylint tap_sling -d missing-docstring -d logging-format-interpolation -d too-many-locals -d too-many-arguments
To check the tap and verify working, install singer-tools.
tap-sling --config tap_config.json --catalog catalog.json | singer-check-tap
Copyright © 2020 Stitch