Singer.io tap for extracting data from Dayforce REST API v1
Project description
tap-dayforce
A Singer tap for extracting data from the Dayforce REST API v1.
Installation
Since package dependencies tend to conflict between various taps and targets, Singer recommends installing taps and targets into their own isolated virtual environments:
Install Dayforce Tap
$ python3 -m venv ~/.venvs/tap-dayforce
$ source ~/.venvs/tap-dayforce/bin/activate
$ pip3 install tap-dayforce
$ deactivate
Install Stitch Target (optional)
$ python3 -m venv ~/.venvs/target-stitch
$ source ~/.venvs/target-stitch/bin/activate
$ pip3 install target-stitch
$ deactivate
Configuration
The tap accepts a JSON-formatted configuration file as arguments. This configuration file has four required fields:
username
: A valid Dayforce web services user account username.password
: A valid Dayforce web services user account password.client_name
: A valid client name (e.g. Company Name) that will be inserted into the request URL.email
: A valid email address to be inserted into theFrom
header of the HTTP Request headers.
It's important to note that the Role attached to the User Account used in the configuration file must have at minimum the "Web Services" feature, as well as the "Read Data" sub-feature enabled:
An bare-bones Dayforce configuration may file may look like the following:
{
"username": "foo",
"password": "bar",
"client_name": "foo_bar",
"email": "foo.bar@gmail.com"
}
Additionally, you may specify more granular configurations for individual streams. Each key under a stream should represent a valid API request parameter for that endpoint. A more fleshed-out configuration file may look similar to the following:
{
"username": "foo",
"password": "bar",
"client_name": "foo_bar",
"email": "foo.bar@gmail.com",
"streams": {
"employees": {
"expand": "EmploymentStatuses,Roles,EmployeeManagers,CompensationSummary,Locations,LastActiveManagers"
},
"employee_punches": {
"filterTransactionStartTimeUTC": "2019-06-01T00:00:00Z"
}
}
}
Streams
The current version of the tap syncs two distinct Streams:
Employees
: Endpoint DocumentationEmployeePunches
: Endpoint Documentation
Discovery
Singer taps describe the data that a stream supports via a Discovery process. You can run the Dayforce tap in Discovery mode by passing the --discover
flag at runtime:
$ ~/.venvs/tap-dayforce/bin/tap-dayforce --config=config/dayforce.config.json --discover
The tap will generate a Catalog to stdout. To pass the Catalog to a file instead, simply redirect it to a file:
$ ~/.venvs/tap-dayforce/bin/tap-dayforce --config=config/dayforce.config.json --discover > catalog.json
Sync to stdout
Running a tap in Sync mode will extract data from the various selected Streams. In order to run a tap in Sync mode and have messages emitted to stdout, pass a valid configuration file and catalog file:
$ ~/.venvs/tap-dayforce/bin/tap-dayforce --config=config/dayforce.config.json --catalog=catalog.json
The tap will emit occasional Metric, Schema, Record, and State messages. You can persist State between runs by redirecting messages to a file:
$ ~/.venvs/tap-dayforce/bin/tap-dayforce --config=config/dayforce.config.json --catalog=catalog.json >> state.json
$ tail -1 state.json > state.json.tmp
$ mv state.json.tmp state.json
Sync to Stitch
You can also send the output of the tap to Stitch Data for loading into the data warehouse. To do this, first create a JSON-formatted configuration for Stitch. This configuration file has two required fields:
client_id
: The ID associated with the Stitch Data account you'll be sending data to.token
The token associated with the specific Import API integration within the Stitch Data account.
An example configuration file will look as follows:
{
"client_id": 1234,
"token": "foobarfoobar"
}
Once the configuration file is created, simply pipe the output of the tap to the Stitch Data target and supply the target with the newly created configuration file:
$ ~/.venvs/tap-dayforce/bin/tap-dayforce --config=config/dayforce.config.json --catalog=catalog.json --state=state.json | ~/.venvs/target-stitch/bin/target-stitch --config=config/stitch.config.json >> state.json
$ tail -1 state.json > state.json.tmp
$ mv state.json.tmp state.json
Development
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tap_dayforce-0.1.0rc1.tar.gz
.
File metadata
- Download URL: tap_dayforce-0.1.0rc1.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 711a98f7bf0effc27126c3f75efcb2a77ffcd332da374279282ad4605d22199c |
|
MD5 | 60be95b32f01d9c24182f3bee73bd67f |
|
BLAKE2b-256 | dd78cb9e1753e4db441e6fd9d5b7a7fc83ace3312e1196d5a4a2994e4d59efd5 |
File details
Details for the file tap_dayforce-0.1.0rc1-py2.py3-none-any.whl
.
File metadata
- Download URL: tap_dayforce-0.1.0rc1-py2.py3-none-any.whl
- Upload date:
- Size: 23.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fd35f10d9259a4c41f92a4484cc03d016398b725ee5b9c597896633ba3a9fdf |
|
MD5 | a741ba1fef3c4ae657c944eb40a87ab8 |
|
BLAKE2b-256 | 7b34bd5fc58747bbef41368826e6cb84ebbeaca16c69f2508e75ed42f97f908f |