{"id":"csv-dialect-detect","version":"1.0.0","description":"Detect delimiter, quote, escape, record separator, and header for one rectangular CSV sample.","supported_operations":["detect csv dialect","detect csv delimiter and quote character","identify csv record separator","decide whether a csv header row is present","classify csv escape and quoting","choose a rectangular csv dialect from a sample","זיהוי ניב של טבלה מופרדת"],"unsupported_operations":["guess a dialect by character frequency","detect a dialect from a ragged or one-column sample","strip a byte order mark or trim cells while detecting"],"semantics":["Candidates are a fixed list: comma, tab, semicolon, and pipe with quote \" and doubled quotes; space with quote | only when the sample contains |; comma with backslash escapes only when the sample contains a backslash. Each is tried with LF, CRLF, and CR.","A candidate fits only when parsing succeeds, the rows are rectangular, there are at least two fields, the delimiter occurs, and a record separator occurs. A single record with no separator fits only the LF candidate.","Zero fits is not_computable insufficient_structure. Two or more fits is not_computable ambiguous_dialect, with details.candidates sorted. A limit hit with no fit is rethrown as limit_exceeded.","Header: with one record, header is absent. Otherwise up to 20 data rows vote. A column is numeric or a single code-point length; a conflict drops the column. Numeric columns vote for a header when the first cell is not numeric. Length columns vote for a header when its length differs. Header is present only when the total is positive.","Assumptions, sorted, record which choice was not evidenced: escape_default_double, quote_default_double_quote, record_separator_default_lf, header_default_absent_single_record.","Cells are not returned. No Unicode normalization, no trim, and no comment stripping. The same sample always yields the same object."],"limits":{"max_input_bytes":1024,"max_records":64,"max_fields":8,"max_field_bytes":256,"max_output_bytes":4096,"max_depth":8},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["sample"],"properties":{"sample":{"type":"string","minLength":1,"maxLength":1024}}},"output_schema":{"type":"object","additionalProperties":false,"required":["dialect","assumptions","record_count","field_count"],"properties":{"dialect":{"type":"object","additionalProperties":false,"required":["delimiter","quote","escape","record_separator","header"],"properties":{"delimiter":{"type":"string","minLength":1,"maxLength":1},"quote":{"type":"string","enum":["\"","|","none"]},"escape":{"type":"string","enum":["double","backslash","none"]},"record_separator":{"type":"string","enum":["\n","\r\n","\r"]},"header":{"type":"string","enum":["present","absent"]}}},"assumptions":{"type":"array","maxItems":4,"uniqueItems":true,"items":{"type":"string","enum":["escape_default_double","header_default_absent_single_record","quote_default_double_quote","record_separator_default_lf"]}},"record_count":{"type":"integer","minimum":1,"maximum":64},"field_count":{"type":"integer","minimum":2,"maximum":8}}},"examples":[{"input":{"sample":"name,age\nAda,36\nGrace,45\n"},"output":{"dialect":{"delimiter":",","quote":"\"","escape":"double","record_separator":"\n","header":"present"},"assumptions":["escape_default_double","quote_default_double_quote"],"record_count":3,"field_count":2}},{"input":{"sample":"aaa,bbb,ccc\r\nzzz,yyy,xxx\r\n"},"output":{"dialect":{"delimiter":",","quote":"\"","escape":"double","record_separator":"\r\n","header":"absent"},"assumptions":["escape_default_double","quote_default_double_quote"],"record_count":2,"field_count":3}},{"input":{"sample":"a,b"},"output":{"dialect":{"delimiter":",","quote":"\"","escape":"double","record_separator":"\n","header":"absent"},"assumptions":["escape_default_double","header_default_absent_single_record","quote_default_double_quote","record_separator_default_lf"],"record_count":1,"field_count":2}}],"execute_url":"/v1/tools/csv-dialect-detect/versions/1.0.0/execute"}