CSV Schema Inference
schema.infer_csv_schema
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
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
Capabilities
Cost & billing
Flat rate per invocation
File handling
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.
| Limit | Value | Limited by |
|---|---|---|
| Maximum size per input file | 4.8 MiB | Skill maximum |
How we handle your data
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.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| csv | string | No | CSV text, 1 to 2097152 characters. Required unless file_ref is provided. |
| file_ref | string | No | Tenant-owned CSV file reference; omit it to read csv. When both are sent this one wins. |
| delimiter | string | No | Column separator; only the first character is used. Omit it for comma. |
| quoteChar | string | No | Quote character; only the first character is used. Omit it for double-quote. |
| header | boolean | No | Whether the first row holds column names; omit it for true. |
| sampleRows | integer | No | How many data rows to read; omit it for 10000. Zero or negative falls back to 10000. |
| detectEnums | boolean | No | Whether to add suggestedEnum on columns with 20 or fewer distinct values; omit it for false. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| columns | array | Yes | Inferred columns in file order, 0 through 10000 closed objects. |
| rowCount | integer | Yes | Data rows counted, excluding the header. |
| columnCount | integer | Yes | How many columns were found. |
| sampleSize | integer | Yes | How many data rows actually fed the statistics. |
| warnings | array | Yes | Non-fatal advisory notices as 0 through 32 strings, each one sentence long; empty when nothing was worth flagging. |
API contract
POST /v1/executecurl -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"}}'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
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 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)
{
"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
{
"csv": "name,age,email,joined\nAlice,30,[email protected],2024-01-15\nBob,25,,2024-03-20"
}{
"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
{
"csv": "status\nactive\ninactive\npending",
"detectEnums": true
}{
"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"
]
}
]
}Recommended use cases
- 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
Related skills
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.