Skip to main content

Singer target for any file type on any file system.

Project description

target-universal-file

target-universal-file is a Singer target built with the Meltano SDK designed to load data to any file system (local, GCP, AWS, etc.) in any format (.csv, .json, .parquet, .xlsx, etc.).

Installation

Install from PyPI:

pipx install target-universal-file

Install from GitHub:

pipx install git+https://github.com/taliawsmiley/target-universal-file.git@main

Add to your Meltano project from the Meltano Hub:

meltano add loader target-universal-file

Configuration

Accepted Config Options

Setting Required Default Description
protocol True None The protocol to connect to the file system. See: Protocols.
file_type True None The file type to use when writing data. See: File Types.
path True None The path on the file system where data will be written.
file_name_format True {stream_name}.{file_type} The format for how to store data. {stream_name} will be replaced with the name of the stream and {file_type} will be replaced with the file type.
protocol_options False None Extended options for the protocol specified in the protocol config. Provide this value as an object with key-value pairs as described by the protocol.See: Protocols.
file_type_options False None Extended options for the file type specified in the file_type config. Provide this value as an object with key-value pairs as described by the file type. See: File Types.
add_record_metadata False None Whether to add metadata fields to records.
load_method False TargetLoadMethods.APPEND_ONLY The method to use when loading data into the destination. append-only will always write all input records whether that records already exists or not. upsert will update existing records and insert new records. overwrite will delete all existing records and insert all input records.
batch_size_rows False None Maximum number of rows in each batch.
validate_records False 1 Whether to validate the schema of the incoming streams.
stream_maps False None Config object for stream maps capability. For more information check out Stream Maps.
stream_map_config False None User-defined config values to be used within map expressions.
faker_config False None Config for the Faker instance variable fake used within map expressions. Only applicable if the plugin specifies faker as an additional dependency (through the singer-sdk faker extra or directly).
faker_config.seed False None Value to seed the Faker generator for deterministic output: https://faker.readthedocs.io/en/master/#seeding-the-generator
faker_config.locale False None One or more LCID locale strings to produce localized output for: https://faker.readthedocs.io/en/master/#localization
flattening_enabled False None 'True' to enable schema flattening and automatically expand nested properties.
flattening_max_depth False None The max depth to flatten schemas.

A full list of supported settings and capabilities for target-universal-file is available by running:

target-universal-file --about

Environment Variables

target-universal-file will automatically import a .env file if --config=ENV is provided,.

Protocols

target-universal-file uses fsspec to easily connect to a wide variety of external file systems. Determine the file system to connect to by specifying a protocol in target configuration.

The supported protocols are:

  1. local: For writing data to a local file.
  2. gcs: For connecting to a bucket on Google Cloud.
  3. s3: For connecting to a bucket on Amazon Web Services.

Local

Protocol: local
Description: For writing data to a local file.
Protocol Options: N/A

Local paths support both relative ./folder and absolute /folder reference.

GCS

Protocol: gcs
Description: For connecting to a bucket on Google Cloud.
Protocol Options: token

The suggested method of authenticating to GCS is to log in with gcloud and copy the provided credentials, such as from ~/.config/gcloud/application_default_credentials.json.

Steps to authenticate:

  1. Install the gcloud CLI.
  2. Run gcloud auth application-default login.
  3. Copy the output file from ~/.config/gcloud/application_default_credentials.json and provide it as an environment variable to protocol_options.token.

Other options are available for authentication as described by the gcsfs documention.

S3

Protocol: local
Description: For connecting to a bucket on Amazon Web Services.
Protocol Options: key, secret

Connecting to an S3 bucket anonymously is not supported.

File Types

target-universal-file supports a variety of data formats. Determine the data format to use by specifying a file_type in target configuration.

The supported file types are:

  1. csv: For Comma-Separated Value files.
  2. jsonl: For JSON Lines files.
  3. parquet: For Apache Parquet files.
  4. xlsx: For Microsoft Excel files.

Usage Example

target-universal-file --version
target-universal-file --help
# Test using the "smoke test" sample tap from Meltano
tap-smoke-test | target-universal-file --config /path/to/target-universal-file-config.json

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

target_universal_file-0.0.1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

target_universal_file-0.0.1-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file target_universal_file-0.0.1.tar.gz.

File metadata

  • Download URL: target_universal_file-0.0.1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for target_universal_file-0.0.1.tar.gz
Algorithm Hash digest
SHA256 04398c81a0df28fed906be07620fc10e77e079c57d6dbec0771d5fc18501191a
MD5 8b2ed60b02bdfdde361cb371715a2b97
BLAKE2b-256 b630166eeff3711f87fa83e03c85272d3778330f2b70ae26686b534560c76d99

See more details on using hashes here.

Provenance

The following attestation bundles were made for target_universal_file-0.0.1.tar.gz:

Publisher: build.yml on taliawsmiley/target-universal-file

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

File details

Details for the file target_universal_file-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for target_universal_file-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11e6c55d9bd40d09d07b3365463cdfc9e7ad2d2beda27a0525069d0a8575ee07
MD5 49df659ca3537e9abd8e1141692a87f8
BLAKE2b-256 a9c9fd7c8079fa5f39f818ea13317d3d4ebce147f50516d0d44a9b44181c3b3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for target_universal_file-0.0.1-py3-none-any.whl:

Publisher: build.yml on taliawsmiley/target-universal-file

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