Package: tap-wonolo
tap-wonoloASingertap for extracting data from theWonolo REST API v2.InstallationSince package dependencies tend to conflict between various taps and targets, Singerrecommendsinstalling taps and targets into their own isolated virtual environments:Install Wonolo Tap$python3-mvenv~/.venvs/tap-wonolo
$source~/.venvs/tap-wonolo/bin/activate
$pip3installtap-wonolo
$deactivateInstall Stitch Target (optional)$python3-mvenv~/.venvs/target-stitch
$source~/.venvs/target-stitch/bin/activate
$pip3installtarget-stitch
$deactivateConfigurationThe tap accepts a JSON-formatted configuration file as arguments. This configuration file has four required fields:api_key: A valid Wonolo API key.secret_key: A valid Wonolo secret key.environment: A valid Wonolo enviroment (either "test" or "production").An bare-bones Wonolo configuration may file may look like the following:{"api_key":"foo","secret_key":"bar","environment":"test"}AuthenticationIf noauth_tokenkey is supplied in the configuration file, the tap will automatically request one via the API and write it back to the config file:{"api_key":"foo","secret_key":"bar","environment":"test","auth_token":"foobar","auth_token_expires_at":"2019-11-08T00:00:20Z",}The tap will then use the aforementionedauth_tokento authenticate to the API, until theauth_tokenbecomes invalidated, at which point the tap will automatically request and record a newauth_tokenfrom the API.Granular Stream ConfigurationAdditionally, 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:{"api_key":"foo","secret_key":"bar","environment":"test","api_version":"v2","streams":{"jobs":{"state":"fulfilled","company_id":"1234","classification":"w2"},"job_requests":{"w2_hourly_rate":21.5,"updated_after":"2017-05-24T17:01:19.391-07:00"}}}StreamsThe current version of the tap syncs three distinctStreams:Jobs:Endpoint DocumentationJob Requests:Endpoint DocumentationUsers:Endpoint DocumentationDiscoverySinger taps describe the data that a stream supports via aDiscoveryprocess. You can run the Dayforce tap in Discovery mode by passing the--discoverflag at runtime:$~/.venvs/tap-wonolo/bin/tap-wonolo--config=config/wonolo.config.json--discoverThe tap will generate aCatalogto stdout. To pass the Catalog to a file instead, simply redirect it to a file:s$~/.venvs/tap-wonolo/bin/tap-wonolo--config=config/wonolo.config.json--discover>catalog.jsonSync to stdoutRunning a tap inSync modewill 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-wonolo/bin/tap-wonolo--config=config/wonolo.config.json--catalog=catalog.jsonThe tap will emit occasionalMetric,Schema,Record, andState messages. You can persist State between runs by redirecting messages to a file:$~/.venvs/tap-wonolo/bin/tap-wonolo--config=config/wonolo.config.json--catalog=catalog.json>>state.json
$tail-1state.json>state.json.tmp
$mvstate.json.tmpstate.jsonSync to StitchYou can also send the output of the tap toStitch Datafor 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.tokenThe token associated with the specificImport API integrationwithin 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-wonolo/bin/tap-wonolo--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-1state.json>state.json.tmp
$mvstate.json.tmpstate.jsonContributingThe first step to contributing is getting a copy of the source code. First,forktap-wonoloon GitHub. Then,cdinto the directory where you want your copy of the source code to live and clone the source code:$gitclonegit@github.com:YourGitHubName/tap-wonolo.gitNow that you have a copy of the source code on your local machine, you can leveragePipenvand the correspondingPipfileto install of the development dependencies within a virtual environment:$pipenvinstall--three--devThis command will create an isolated virtual environment for yourtap-wonoloproject and install all the development dependencies defined within thePipfileinside of the environment. You can then enter a shell within the environment:$pipenvshellOr, you can run individual commands within the environment without entering the shell:$pipenvrun<command>For example, to format your code usingisortandflake8before commiting changes, run the following commands:$pipenvrunmakeisort
$pipenvrunmakeflake8You can also run the entire testing suite before committing usingtox:$pipenvruntoxFinally, you can run your local version of the tap within the virtual environment using a command like the following:$pipenvruntap-wonolo--config=config/dayforce.config.json--catalog=catalog.jsonOnce you've confirmed that your changes work and the testing suite passes, feel free to put out a PR!