Skip to main content

Singer target for CSV, built with the Meltano SDK for Singer Targets.

Project description

target-csv

A Singer target that generates CSV files.

Built with the Meltano SDK for Singer Taps and Targets.

Capabilities

  • target

Settings

Setting Required Default Description
output_path False None Filesystem path where to store output files. By default, the current working directory will be used. When specified, the output directory will be created automatically.
file_naming_scheme False {stream_name}.csv The scheme with which output files will be named. Naming scheme may leverage any of the following substitutions:
- {stream_name}
- {datestamp}
- {timestamp}
datestamp_format False %Y-%m-%d A python format string to use when outputting the {datestamp} string. For reference, see: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes
timestamp_format False %Y-%m-%d.T%H%M%S A python format string to use when outputting the {timestamp} string. For reference, see: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes
timestamp_timezone False UTC The timezone code or name to use when generating {timestamp} and {datestamp}. Defaults to 'UTC'. For a list of possible values, please see: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
stream_maps False None Allows inline stream transformations and aliasing. For more information see: https://sdk.meltano.com/en/latest/stream_maps.html
record_sort_property_name False None A property in the record which will be used as a sort key.

If this property is omitted, records will not be sorted.
overwrite_behavior False replace_file Determines the overwrite behavior if destination file already exists. Must be one of the following string values:

- append_records (default) - append records at the insertion point
- replace_file - replace entire file using default_CSV_template
escape_characters False None A string of characters to escape when writing CSV files.

A full list of supported settings and capabilities is available by running: target-csv --about

Installation

pipx install git+https://github.com/MeltanoLabs/target-csv.git

Usage

You can easily run target-csv by itself or in a pipeline using Meltano.

Executing the Target Directly

target-csv --version
target-csv --help

# Test using the "Carbon Intensity" sample:
tap-carbon-intensity | target-csv --config /path/to/target-csv-config.json

# Test using the "Smoke Test" tap:
tap-smoke-test --config=tap-smoke-test-config.json | target-csv

Developer Resources

  • Developer TODO: As a first step, scan the entire project for the text "TODO:" and complete any recommended steps, deleting the "TODO" references once completed.

Initialize your Development Environment

pipx install poetry
poetry install

Create and Run Tests

Create tests within the target_csv/tests subfolder and then run:

poetry run pytest

You can also test the target-csv CLI interface directly using poetry run:

poetry run target-csv --help

Testing with Meltano

Note: This target will work in any Singer environment and does not require Meltano. Examples here are for convenience and to streamline end-to-end orchestration scenarios.

Your project comes with a custom meltano.yml project file already created. Open the meltano.yml and follow any "TODO" items listed in the file.

Next, install Meltano (if you haven't already) and any needed plugins:

# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd target-csv
meltano install

Now you can test and orchestrate using Meltano:

# Test invocation:
meltano invoke target-csv --version
# OR run a test `elt` pipeline with the Carbon Intensity sample tap:
meltano elt tap-smoke-test target-csv
# Or with debug logging:
meltano --log-level=debug elt tap-smoke-test target-csv

SDK Dev Guide

See the dev guide for more instructions on how to use the Meltano SDK to develop your own Singer taps and targets.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meltanolabs_target_csv-0.1.0a1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meltanolabs_target_csv-0.1.0a1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file meltanolabs_target_csv-0.1.0a1.tar.gz.

File metadata

File hashes

Hashes for meltanolabs_target_csv-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 766e39df00b6b1b7e1bddd53cc0f1e6f30e3b82d21a483870756e9c5f5dfd1c9
MD5 929d907c51ca98d6636785b6cb66000f
BLAKE2b-256 8b071fb84cd9f1b158ff80cba983c151d80a9e3f8ce724b7f7de8f576b96e49a

See more details on using hashes here.

Provenance

The following attestation bundles were made for meltanolabs_target_csv-0.1.0a1.tar.gz:

Publisher: build.yml on MeltanoLabs/target-csv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file meltanolabs_target_csv-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for meltanolabs_target_csv-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 159b19788d202e43936aef304e01fd9d124c475b26e96ca5570c9a93ba5ce75e
MD5 c156d7c421c1533e6a62a2c90f69cbc6
BLAKE2b-256 ab4f4736d6bed5cc1579e754cbf7023a81cbc09f14ca3723547e24a744eb4091

See more details on using hashes here.

Provenance

The following attestation bundles were made for meltanolabs_target_csv-0.1.0a1-py3-none-any.whl:

Publisher: build.yml on MeltanoLabs/target-csv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page