Skip to main content

target-s3

PyPI version CI Python License: Apache 2.0

target-s3 is a multi-format/multi-cloud Singer target, writing streams to S3-compatible object storage (AWS S3, MinIO, ...) as JSON, JSONL, CSV, or Parquet.

Built with the Meltano Target SDK.

Provenance: this is the plinxore fork of crowemi/target-s3, matured for production use: real gzip compression (the original wrote plaintext behind a misleading .gz extension), corrected JSONL datetime serialization, configurable handling of unparseable source dates (e.g. legacy MySQL/MyISAM zero-dates), and a collision-safe batch filename scheme that guarantees a rerun can never silently overwrite a previous run's files. See NOTICE for the full derivation statement required by the Apache 2.0 license.

Installation

pip install plinxore-target-s3

Configuration

Accepted Config Options

{
    "format": {
        "format_type": "json",
        "format_parquet": {
            "validate": true|false
        },
        "format_json": {},
        "format_csv": {}
    },
    "cloud_provider": {
        "cloud_provider_type": "aws",
        "aws": {
            "aws_access_key_id": "test",
            "aws_secret_access_key": "test",
            "aws_region": "us-west-2",
            "aws_profile_name": "test-profile",
            "aws_bucket": "test-bucket",
            "aws_endpoint_override": "http://localhost:4566"
        }
    },
    "compression": "gzip|none",
    "datetime_error_treatment": "null|max|error",
    "prefix": "path/to/output",
    "stream_name_path_override": "StreamName",
    "include_process_date": true|false,
    "append_date_to_prefix": true|false,
    "partition_name_enabled": true|false,
    "use_raw_stream_name": true|false,
    "append_date_to_prefix_grain": "day",
    "append_date_to_filename": true|false,
    "append_date_to_filename_grain": "microsecond",
    "flattening_enabled": true|false,
    "flattening_max_depth": int,
    "max_batch_age": int,
    "max_batch_size": int,
    "partition_by": ["tenant=${TENANT}", "dt=${CURRENT_DATE_MINUTE_LEVEL}"]
}

format.format_parquet.validate [Boolean, default: False] - this flag determines whether the data types of incoming data elements should be validated. When set True, a schema is created from the first record and all subsequent records that don't match that data type are cast.

  • partition_by [Array[String], optional]: List of key-value strings (e.g., 'tenant=${TENANT}') to be inserted as partition folders after the stream name in the S3 key path. For example, if partition_by: ['tenant=${TENANT}', 'dt=${CURRENT_DATE_MINUTE_LEVEL}'] and the stream is Account, the S3 key will look like:

    bucket/prefix/Account/tenant=${TENANT}/dt=${CURRENT_DATE_MINUTE_LEVEL}/...
    
  • compression [String, default: "gzip", allowed: "none", "gzip"] - compression applied to written files. "gzip" produces real gzip output (verified with gzip -t, not just a .gz-named file); "none" disables compression.

  • datetime_error_treatment [String, default: "null", allowed: "null", "max", "error"] - how to handle date/date-time values the SDK can't parse, such as legacy MySQL/MyISAM zero-dates ("0000-00-00 00:00:00"). "null" replaces the value with null so the run continues; "error" aborts the run (the SDK's own default behavior if this were unset).

Object key uniqueness & idempotency

Every object key ends in -part-{batch_number:05d}-{uuid} (e.g. .../year=2026/month=08/day=11/invoices-part-00001-3f2504e0-4f89-11d3-9a0c-0305e82c3301.jsonl.gz), appended after any append_date_to_filename suffix:

  • batch_number is a monotonic counter, reset to 1 at the start of every run, giving batches a readable, ordered position within that run.
  • The UUID is generated fresh per batch and is what actually guarantees uniqueness: two different runs of the same stream (e.g. a same-day retry) both start counting batches at 1, so the counter alone cannot prevent one run's files from colliding with another's -- the UUID makes that collision structurally impossible regardless of how many times a stream is replayed.

This target only guarantees that a rerun can never silently overwrite a previous run's objects. It does not decide whether a rerun's data should replace or add to what's already been written -- that's a downstream/consumer decision, made per table by how the pipeline reads the objects back:

  • A full-refresh table points its reader at a fixed, cleared/replaced path each run.
  • An incremental table reads via a glob over the date partition (year=*/month=*/day=*/*.jsonl.gz) and is expected to accumulate every run's files.

Which of those two a given table needs is decided outside this target (e.g. which path or glob a downstream reader like ClickHouse's s3() table function is pointed at).

Capabilities

  • about
  • stream-maps
  • schema-flattening

Settings

Configure using environment variables

This Singer target will automatically import any environment variables within the working directory's .env if the --config=ENV is provided, such that config values will be considered if a matching environment variable is set either in the terminal context or in the .env file.

Usage

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

Direct CLI (without Meltano)

target-s3 --version
target-s3 --about
# Test using the "Carbon Intensity" sample:
tap-carbon-intensity | target-s3 --config /path/to/target-s3-config.json
# Install the Meltano CLI (if not already done)
pipx install meltano

# Add this variant explicitly
meltano add loader target-s3 --variant plinxore

# Install the plugins declared in meltano.yml
meltano install

# Run the pipeline
meltano run tap-mysql target-s3

Development

Tests

uv run pytest              # fast suite (excludes the load test)
uv run pytest -m load      # permanent >=1M-record memory/throughput regression test (several minutes)

SDK Dev Guide

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

Metadata

Release files for plinxore-target-s3 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plinxore-target-s3 0.1.1
File Size Uploaded Provenance
plinxore_target_s3-0.1.1.tar.gz 263.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for plinxore-target-s3 0.1.1
File Interpreter ABI Platform
plinxore_target_s3-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 452.8 kB

Release files / plinxore_target_s3-0.1.1.tar.gz

Download URL plinxore_target_s3-0.1.1.tar.gz
Size 263.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2c8b72882b598a45fbbfc674851d0d31b5b5bc17d1d32b3f7621f749731cccef
BLAKE2b-256 checksum
How to use checksums
e606c343a3f9243a33d39bbb026c43edf595d536e35ab78cc7330fe77ea66168
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / plinxore_target_s3-0.1.1-py3-none-any.whl

Download URL plinxore_target_s3-0.1.1-py3-none-any.whl
Size 189.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc51a9950043a6a7fd6310d699cfa04835383fbfce4b8c17797b3aef5d104449
BLAKE2b-256 checksum
How to use checksums
67a31bce68de23d6d1e08e2d105ce70268d7ba5752023ef9d74c9e59c3b8503f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for plinxore-target-s3 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page