Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

CSV Schema Inference

schema.infer_csv_schema

ProductionHeuristic (Class C)Deterministicbest-effortfastv1.0.0
File inputNo network

Overview

You send CSV data and we read a bounded sample of its rows to describe each column: the name, the type we think it holds, whether any cell is empty, how many distinct values we saw, and a few real examples. Ask for it and we also suggest an allowed-value list for columns with few distinct values. This is a well-founded guess from the rows we read, not a guarantee about rows we have not seen, so treat the result as a starting point and check data with schema.validate_csv_schema. Accepts file input via file_ref — no need to extract file content first.

Opening an unknown export and eyeballing it does not scale, and guessing the column types is how imports break at three in the morning. You get the shape of the file in one call.

Reliability

Best-effort by design, and repeatable: the same text and the same options always give the same answer, but the answer describes the rows we read, not rows we have not seen. A column is integer only when every non-empty cell parses as a whole number, number when every cell parses as a number, boolean when every cell is true, false, 0 or 1, date when every cell looks like YYYY-MM-DD, and string otherwise; a column with nothing but empty cells is reported as string. Distinct values are counted up to 1000, so distinctCount saturates on very high-cardinality columns. We reject the call, and an unchanged retry will not help, when neither csv nor file_ref is present, when the text is not parseable as CSV with the delimiter and quote you gave, when it exceeds 10485760 bytes, or when a referenced file is missing, unreadable or over 5000000 bytes.

Context footprint

Inline text is capped at 2097152 characters and a referenced file at 5000000 bytes; the response holds one short row per column, whatever the file size. A successful call costs 1 execution credit.

When to use it

The first time you meet a CSV and need to know its columns, their types, and where the gaps are.

When the column rules are already settled and you simply want data checked against them, or when you want the data cleaned up.

Powered by Apache Commons CSV, a hardened RFC 4180 parser relied on across the Java ecosystem for robust CSV handling.

Scope

Note
We read a bounded sample of your CSV and describe each column: type, emptiness, how many distinct values, a few real examples, and optionally an allowed-value list.

Non-goals

  • We never check data against a schema — that is schema.validate_csv_schema
  • We never clean, reshape, or rewrite your CSV — that is data.csv_normalize
  • We never guess the delimiter for you; tell us if it is not a comma

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysisparsing

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input2 MBMax file size4.8 MB

File limits

Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.

LimitValueLimited by
Maximum size per input file4.8 MiBSkill maximum

How we handle your data

Sensitive output possible
What this means

This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response may contain submitted or transformed content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
csvstringNoCSV text, 1 to 2097152 characters. Required unless file_ref is provided.
file_refstringNoTenant-owned CSV file reference; omit it to read csv. When both are sent this one wins.
delimiterstringNoColumn separator; only the first character is used. Omit it for comma.
quoteCharstringNoQuote character; only the first character is used. Omit it for double-quote.
headerbooleanNoWhether the first row holds column names; omit it for true.
sampleRowsintegerNoHow many data rows to read; omit it for 10000. Zero or negative falls back to 10000.
detectEnumsbooleanNoWhether to add suggestedEnum on columns with 20 or fewer distinct values; omit it for false.

Output schema

FieldTypeRequiredDescription
columnsarrayYesInferred columns in file order, 0 through 10000 closed objects.
rowCountintegerYesData rows counted, excluding the header.
columnCountintegerYesHow many columns were found.
sampleSizeintegerYesHow many data rows actually fed the statistics.
warningsarrayYesNon-fatal advisory notices as 0 through 32 strings, each one sentence long; empty when nothing was worth flagging.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"schema.infer_csv_schema","input":{"csv":"name,age\nAlice,30"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("schema.infer_csv_schema", {"csv":"name,age,email,joined\nAlice,30,[email protected],2024-01-15\nBob,25,,2024-03-20"});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • We never check data against a schema — that is schema.validate_csv_schema
  • We never clean, reshape, or rewrite your CSV — that is data.csv_normalize
  • We never guess the delimiter for you; tell us if it is not a comma
  • Checking a CSV against rules you already have (schema.validate_csv_schema)
  • Cleaning or reshaping the data (data.csv_normalize)
  • Profiling JSON, XML, or any other non-tabular format

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "schema.infer_csv_schema",
  "input": {
    "csv": "name,age,email,joined\nAlice,30,[email protected],2024-01-15\nBob,25,,2024-03-20"
  }
}

Examples

Infer schema from user data CSV

Inputjson
{
  "csv": "name,age,email,joined\nAlice,30,[email protected],2024-01-15\nBob,25,,2024-03-20"
}
Expected outputjson
{
  "warnings": [],
  "sampleSize": 2,
  "rowCount": 2,
  "columnCount": 4,
  "columns": [
    {
      "nullCount": 0,
      "nullable": false,
      "sampleValues": [
        "Alice",
        "Bob"
      ],
      "distinctCount": 2,
      "inferredType": "string",
      "name": "name"
    },
    {
      "nullCount": 0,
      "nullable": false,
      "sampleValues": [
        "30",
        "25"
      ],
      "distinctCount": 2,
      "inferredType": "integer",
      "name": "age"
    },
    {
      "nullCount": 1,
      "nullable": true,
      "sampleValues": [
        "[email protected]"
      ],
      "distinctCount": 1,
      "inferredType": "string",
      "name": "email"
    },
    {
      "nullCount": 0,
      "nullable": false,
      "sampleValues": [
        "2024-01-15",
        "2024-03-20"
      ],
      "distinctCount": 2,
      "inferredType": "date",
      "name": "joined"
    }
  ]
}

Suggest enum for low-cardinality column

Inputjson
{
  "csv": "status\nactive\ninactive\npending",
  "detectEnums": true
}
Expected outputjson
{
  "warnings": [],
  "sampleSize": 3,
  "rowCount": 3,
  "columnCount": 1,
  "columns": [
    {
      "inferredType": "string",
      "distinctCount": 3,
      "suggestedEnum": [
        "active",
        "inactive",
        "pending"
      ],
      "name": "status",
      "nullCount": 0,
      "nullable": false,
      "sampleValues": [
        "active",
        "inactive",
        "pending"
      ]
    }
  ]
}
  • Find out what an unfamiliar CSV export actually contains before you process it
  • Draft the column rules you will later enforce with schema.validate_csv_schema
  • Document a dataset for someone who has never opened it

Avoid for

  • Checking a CSV against rules you already have (schema.validate_csv_schema)
  • Cleaning or reshaping the data (data.csv_normalize)
  • Profiling JSON, XML, or any other non-tabular format

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

dataanalysiscsv