Singer.io tap for extracting data from Pivotal Tracker REST API
Project description
tap-pivotal-tracker
A Singer tap for extracting data from the Pivotal Tracker REST API.
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 Pivotal Tracker Tap
$ python3 -m venv ~/.venvs/tap-pivotal-tracker
$ source ~/.venvs/tap-pivotal-tracker/bin/activate
$ pip3 install tap-pivotal-tracker
$ 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 s single required field:
api_token
: A valid Pivotal Tracker API token.
A token for the Pivotal Tracker API can be obtained following the instructions here. A bare-bones tap configuration may file may look like the following:
{
"api_token": "foobar",
}
Granular Stream Configuration
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:
{
"api_token": "foobar",
"api_version": "v5",
"streams": {
"stories": {
"created_after": "2019-01-01T00:00:00",
"limit": 500,
"with_story_type": "bug",
"with_state": "accepted",
"with_label": "data-team"
},
"project_memberships": {
"role": "owner"
}
}
}
Streams
The current version of the tap syncs five distinct Streams:
Accounts
: Endpoint DocumentationLabels
: Endpoint DocumentationProjects
: Endpoint DocumentationProject Memberships
: Endpoint DocumentationStories
: 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-pivotal-tracker/bin/tap-pivotal-tracker --config=config/pivotal.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:s
$ ~/.venvs/tap-pivotal-tracker/bin/tap-pivotal-tracker --config=config/pivotal.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-pivotal-tracker/bin/tap-pivotal-tracker --config=config/pivotal.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-pivotal-tracker/bin/tap-pivotal-tracker --config=config/pivotal.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.
An example configuration file will look as follows:
{
"client_id": 1234,
"token": "foobar",
"small_batch_url": "https://api.stitchdata.com/v2/import/batch",
"big_batch_url": "https://api.stitchdata.com/v2/import/batch",
"batch_size_preferences": {}
}
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-pivotal-tracker/bin/tap-pivotal-tracker --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
Contributing
The first step to contributing is getting a copy of the source code. First, fork tap-pivotal-tracker
on GitHub. Then, cd
into the directory where you want your copy of the source code to live and clone the source code:
$ git clone git@github.com:YourGitHubName/tap-pivotal-tracker.git
Now that you have a copy of the source code on your local machine, you can leverage Pipenv and the corresponding Pipfile
to install of the development dependencies within a virtual environment:
$ pipenv install --three --dev
This command will create an isolated virtual environment for your tap-pivotal-tracker
project and install all the development dependencies defined within the Pipfile
inside of the environment. You can then enter a shell within the environment:
$ pipenv shell
Or, you can run individual commands within the environment without entering the shell:
$ pipenv run <command>
For example, to format your code using isort and flake8 before commiting changes, run the following commands:
$ pipenv run make isort
$ pipenv run make flake8
You can also run the entire testing suite before committing using tox:
$ pipenv run tox
Finally, you can run your local version of the tap within the virtual environment using a command like the following:
$ pipenv run tap-pivotal-tracker --config=config/pivotal.config.json --catalog=catalog.json
Once you've confirmed that your changes work and the testing suite passes, feel free to put out a PR!
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_pivotal_tracker-0.1.1.tar.gz
.
File metadata
- Download URL: tap_pivotal_tracker-0.1.1.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b391903a5eeedf922f990b0da1fd171365bf8d8fc49914188d960d3588342bcd |
|
MD5 | 4101028ddd2dc7471fb474e8d2dfae65 |
|
BLAKE2b-256 | 4306560f98a79e25f500e07fb6ecaf4fc57d1dca5c01514980670433e448c9fa |
File details
Details for the file tap_pivotal_tracker-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: tap_pivotal_tracker-0.1.1-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 065354d30a2cec7e4002720f4e392e0dd2832bcb14da5b89a710944fc80ad32c |
|
MD5 | a54fa9cb40612fb61df07a272da2a10a |
|
BLAKE2b-256 | 605c40e1c88d67e88dba716ae28c67536c6ee55b508bacdcf035ef81a12cd0d9 |