{"id":5511,"library":"target-jsonl","title":"target-jsonl","description":"target-jsonl is a Singer.io target that writes incoming data streams into JSON Line (.jsonl) files. It's designed to integrate seamlessly within the Singer ETL ecosystem, allowing data extracted by a 'tap' to be consumed and stored as line-delimited JSON. The current version is 0.1.4, and it has an irregular release cadence driven by contributions.","status":"active","version":"0.1.4","language":"en","source_language":"en","source_url":"https://github.com/andyh1203/target-jsonl","tags":["singer.io","etl","jsonl","target","data-pipeline"],"install":[{"cmd":"pip install target-jsonl","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core library for building Singer.io taps and targets.","package":"singer-python","optional":false},{"reason":"Used for timezone handling in data processing.","package":"pytz","optional":false}],"imports":[],"quickstart":{"code":"import json\nimport subprocess\nimport os\nimport shutil\n\n# Create a dummy config file\nconfig_path = \"config.json\"\noutput_dir = \"./output_jsonl\"\n\nif os.path.exists(output_dir):\n    shutil.rmtree(output_dir)\n\nconfig = {\n    \"destination_path\": output_dir,\n    \"custom_name\": \"my_data_stream\",\n    \"decimal_precision\": 4\n}\nwith open(config_path, \"w\") as f:\n    json.dump(config, f)\n\n# Create dummy input data (mimicking a tap's output)\ninput_data = [\n    {\"type\": \"SCHEMA\", \"stream\": \"users\", \"schema\": {\"properties\": {\"id\": {\"type\": [\"null\", \"integer\"]}, \"name\": {\"type\": [\"null\", \"string\"]}, \"value\": {\"type\": [\"null\", \"number\"]}, \"ts\": {\"type\": [\"null\", \"string\"], \"format\": \"date-time\"}}}, \"key_properties\": [\"id\"]},\n    {\"type\": \"RECORD\", \"stream\": \"users\", \"record\": {\"id\": 1, \"name\": \"Alice\", \"value\": 100.123456, \"ts\": \"2023-01-01T12:00:00Z\"}},\n    {\"type\": \"RECORD\", \"stream\": \"users\", \"record\": {\"id\": 2, \"name\": \"Bob\", \"value\": 200.789, \"ts\": \"2023-01-01T13:00:00Z\"}}\n]\n\n# Simulate piping data to target-jsonl\ntry:\n    process = subprocess.Popen(\n        [\"target-jsonl\", \"--config\", config_path],\n        stdin=subprocess.PIPE,\n        stdout=subprocess.PIPE,\n        stderr=subprocess.PIPE,\n        text=True\n    )\n\n    for line in input_data:\n        process.stdin.write(json.dumps(line) + \"\\n\")\n    process.stdin.flush()\n    process.stdin.close()\n\n    stdout, stderr = process.communicate(timeout=10)\n\n    if process.returncode != 0:\n        print(f\"Error running target-jsonl:\\n{stderr}\")\n    else:\n        print(f\"target-jsonl ran successfully. Output files in {output_dir}\")\n        # Verify output\n        output_file = os.path.join(output_dir, \"my_data_stream-users.jsonl\")\n        if os.path.exists(output_file):\n            print(f\"Content of {output_file}:\")\n            with open(output_file, \"r\") as f:\n                for line in f:\n                    print(line.strip())\n        else:\n            print(f\"Output file not found: {output_file}\")\n\nfinally:\n    # Clean up\n    os.remove(config_path)\n    if os.path.exists(output_dir):\n        shutil.rmtree(output_dir)\n","lang":"python","description":"This quickstart demonstrates how to run `target-jsonl` by simulating a Singer tap piping data to it. It creates a configuration file, generates dummy Singer messages (SCHEMA and RECORD), pipes them to the target, and then verifies the output JSONL file. The `destination_path` and `custom_name` are configured, and the decimal precision is explicitly set."},"warnings":[{"fix":"Upgrade to v0.1.4 or later, or ensure the `destination_path` directory exists before running `target-jsonl` on older versions.","message":"Prior to version 0.1.4, `target-jsonl` did not automatically create the `destination_path` directory if it did not already exist. This would lead to errors if the target directory was not manually prepared beforehand.","severity":"gotcha","affected_versions":"<0.1.4"},{"fix":"Explicitly set the `decimal_precision` configuration option in your `config.json` to the desired level, or set it to `None` to prevent rounding, if precise floating-point representation is critical.","message":"Version 0.1.3 introduced an adjustment to decimal precision (defaulting to 2). If your pipeline implicitly relied on a different precision or lack of explicit rounding for numeric types, this change could alter your data. You can configure `decimal_precision` to a higher value or 'None' to disable rounding.","severity":"gotcha","affected_versions":">=0.1.3"},{"fix":"Ensure the user account executing `target-jsonl` has appropriate write permissions for the configured `destination_path`.","message":"As a file-based target, `target-jsonl` requires write permissions for the user running the process in the specified `destination_path`. Insufficient permissions will result in runtime errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}