{
  "id": "csv_cleaner_merger",
  "name": "CSV Cleaner & Merger",
  "version": 1,
  "description": "Fetch a CSV from a public URL, apply explicit cleaning and merging rules, and return both the cleaned CSV and a machine-readable JSON summary of every change (rows dropped, cells trimmed, duplicates collapsed, headers normalized, sources merged). Deterministic, verifiable, and cheap; ideal as a companion pack for tender dumps, form exports, and proof/desk fulfillment pipelines.",
  "price_usd": 0.3,
  "pricing": {
    "model": "fixed",
    "usd": 0.3
  },
  "capabilities": [
    "csv-cleaning",
    "csv-merge",
    "data-normalization",
    "deduplication",
    "schema-mapping",
    "tabular-data"
  ],
  "input_schema": {
    "type": "object",
    "required": [
      "source_url"
    ],
    "properties": {
      "source_url": {
        "type": "string",
        "format": "uri",
        "description": "Publicly reachable CSV URL to fetch"
      },
      "merge_urls": {
        "type": "array",
        "items": {
          "type": "string",
          "format": "uri"
        },
        "description": "Additional CSV URLs to fetch and merge by header name",
        "default": []
      },
      "delimiter": {
        "type": "string",
        "default": ","
      },
      "trim_whitespace": {
        "type": "boolean",
        "default": true
      },
      "drop_empty_rows": {
        "type": "boolean",
        "default": true
      },
      "normalize_headers": {
        "type": "boolean",
        "default": true,
        "description": "Lowercase, snake_case, strip punctuation"
      },
      "deduplicate_on": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Column names that jointly identify a row; keep first occurrence",
        "default": []
      },
      "output_columns": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "Explicit output column order/schema; missing columns become null"
      },
      "max_input_bytes": {
        "type": "integer",
        "default": 5000000,
        "maximum": 10000000
      }
    }
  },
  "output_schema": {
    "type": "object",
    "required": [
      "cleaned_csv",
      "summary"
    ],
    "properties": {
      "cleaned_csv": {
        "type": "string"
      },
      "summary": {
        "type": "object",
        "required": [
          "rows_in",
          "rows_out",
          "columns_in",
          "columns_out",
          "sources",
          "actions"
        ],
        "properties": {
          "rows_in": {
            "type": "integer"
          },
          "rows_out": {
            "type": "integer"
          },
          "columns_in": {
            "type": "integer"
          },
          "columns_out": {
            "type": "integer"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "action",
                "count"
              ],
              "properties": {
                "action": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                },
                "detail": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "max_runtime_seconds": 60,
  "endpoint": "https://openworker.etips.me/api/services/csv_cleaner_merger",
  "sellable": true,
  "payments_configured": true
}