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
uv tool install --from meltanolabs-target-csv target-csv
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
uv sync
Create and Run Tests
Create tests within the target_csv/tests subfolder and
then run:
uv run pytest
You can also test the target-csv CLI interface directly using uv run:
uv 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:
uv tool install meltano
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 run tap-smoke-test target-csv
# Or with debug logging:
meltano --log-level=debug run 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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file meltanolabs_target_csv-0.3.0.tar.gz.
File metadata
- Download URL: meltanolabs_target_csv-0.3.0.tar.gz
- Upload date:
- Size: 89.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0e7fbb28297de1a40eb4560ec5036477222cef4bfcfade2578c837fe8c8860c
|
|
| MD5 |
3372993d5334f7b68442a8e96ec59f8e
|
|
| BLAKE2b-256 |
3cedd03db15306180f4b3f429acc6c4d833822e576761bcc41c6e557849dac95
|
Provenance
The following attestation bundles were made for meltanolabs_target_csv-0.3.0.tar.gz:
Publisher:
build.yml on MeltanoLabs/target-csv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meltanolabs_target_csv-0.3.0.tar.gz -
Subject digest:
e0e7fbb28297de1a40eb4560ec5036477222cef4bfcfade2578c837fe8c8860c - Sigstore transparency entry: 765754975
- Sigstore integration time:
-
Permalink:
MeltanoLabs/target-csv@4ca1cea8b03cdeb00abd3b081016412d99efa28e -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/MeltanoLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@4ca1cea8b03cdeb00abd3b081016412d99efa28e -
Trigger Event:
push
-
Statement type:
File details
Details for the file meltanolabs_target_csv-0.3.0-py3-none-any.whl.
File metadata
- Download URL: meltanolabs_target_csv-0.3.0-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
077d14151096b57e805ffc6c817314a89076d2f3b0d90b5afd5097cb0ea9f6d3
|
|
| MD5 |
f0a9861dba48c382b41cdc48b0bcba40
|
|
| BLAKE2b-256 |
13f3c1c4fd7610078b8643c96a83f012e7efbed29d90b98f68b8deaa51aed943
|
Provenance
The following attestation bundles were made for meltanolabs_target_csv-0.3.0-py3-none-any.whl:
Publisher:
build.yml on MeltanoLabs/target-csv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meltanolabs_target_csv-0.3.0-py3-none-any.whl -
Subject digest:
077d14151096b57e805ffc6c817314a89076d2f3b0d90b5afd5097cb0ea9f6d3 - Sigstore transparency entry: 765755044
- Sigstore integration time:
-
Permalink:
MeltanoLabs/target-csv@4ca1cea8b03cdeb00abd3b081016412d99efa28e -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/MeltanoLabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@4ca1cea8b03cdeb00abd3b081016412d99efa28e -
Trigger Event:
push
-
Statement type: