Skip to content



Repository files navigation


A Singer target that writes data to CSV files.

How to use it

target-csv works together with any other Singer Tap to move data from sources like Braintree, Freshdesk and Hubspot to CSV-formatted files. It is commonly used for loading data into tools like Excel or simply storing a backup of the source data set.


We will use tap-exchangeratesapi to pull currency exchange rate data from a public data set as an example.

First, make sure Python 3 is installed on your system or follow these installation instructions for Mac or Ubuntu.

It is recommended to install each Tap and Target in a separate Python virtual environment to avoid conflicting dependencies between any Taps and Targets.

 # Install tap-exchangeratesapi in its own virtualenv
python3 -m venv ~/.virtualenvs/tap-exchangeratesapi
source ~/.virtualenvs/tap-exchangeratesapi/bin/activate
pip install tap-exchangeratesapi

# Install target-csv in its own virtualenv
python3 -m venv ~/.virtualenvs/target-csv
source ~/.virtualenvs/target-csv/bin/activate
pip install target-csv


We can now run tap-exchangeratesapi and pipe the output to target-csv.

~/.virtualenvs/tap-exchangeratesapi/bin/tap-exchangeratesapi | ~/.virtualenvs/target-csv/bin/target-csv

The data will be written to a file called exchange_rate-{timestamp}.csv in your working directory.

› cat exchange_rate-{timestamp}.csv

Optional Configuration

target-csv takes an optional configuration file that can be used to set formatting parameters like the delimiter - see config.sample.json for examples. To run target-csv with the configuration file, use this command:

~/.virtualenvs/tap-exchangeratesapi/bin/tap-exchangeratesapi | ~/.virtualenvs/target-csv/bin/target-csv -c my-config.json

Copyright © 2017 Stitch