# CSV Quality Report (`globose_keypress_hwl/csv-quality-report`) Actor

Validate CSV before import: structural errors, required values, tuple duplicate keys and spreadsheet formula hints. Deterministic, no AI.

- **URL**: https://apify.com/globose_keypress_hwl/csv-quality-report.md
- **Developed by:** [td w](https://apify.com/globose_keypress_hwl) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## CSV Quality Report

Check a pasted customer, product or business CSV before importing it. Get a JSON report and an issue table with locations, without altering data. No AI, web requests, formula execution or automatic repairs.

### Try it

Click **Try for free**, paste CSV into **CSV text**, select the delimiter and optionally required/key columns, then click **Start**. Open **JSON report** (REPORT in key-value storage) and **Issue locations** (Dataset). A clean CSV has an empty Dataset: always check REPORT for the verdict.

#### Example: fictional data

```json
{
  "csvText": "id,email,amount\n1,ada@example.com,10\n1,,=SUM(A1)\n3,bob@example.com,-5\n",
  "delimiter": ",",
  "requiredColumns": [
    "id",
    "email"
  ],
  "keyColumns": [
    "id"
  ]
}
```

Exactly three issues on logical record 3: empty email (column 2), duplicate id key (columns \[1], first occurrence record 2), formula risk (column 3). Ordinary negative -5 on record 4 is not flagged.

Clean example:

```json
{
  "csvText": "id,email,amount\n1,ada@example.com,10\n2,bob@example.com,-5\n",
  "requiredColumns": [
    "id",
    "email"
  ],
  "keyColumns": [
    "id"
  ]
}
```

Expected status valid, zero issues.

### Checks and output

Empty input, duplicate/blank header, row-width mismatch, malformed CSV, detectable Unicode problems, required blank values, duplicate tuple keys, and potential spreadsheet formulas. Exact column names are used. Empty keys are separate issues and excluded from duplicates. No business key inferred; whitespace in nonempty keys is significant. Leading =, +, @ or nonnumeric - is flagged, not ordinary negative decimals/scientific notation. This is a hint, not a complete spreadsheet security guarantee.

REPORT has status valid/invalid/config_error, complete, counts and issues. Issues have type and recordNumber, plus columnName/columnNumber (or key column arrays) when applicable. **recordNumber is a logical CSV record: header=1, first data record=2, not physical line numbers.** Quoted commas and multiline fields work. Input-wide errors use null locations; row-width issues identify first extra/missing column.

No raw cell values or original rows in reports or logs. Column names from your input are included: treat exported reports as untrusted data, especially spreadsheet exports containing crafted headers.

### Limits and privacy

CSV text only, maximum **1 MiB UTF-8**. Larger input rejected, never silently truncated. Up to 10,000 issues stored; extra issues counted, truncated=true and complete=false. Parse failures stop further checks with complete=false. Clean/defective CSV return reports; configuration errors are explicit. Header-only is structurally valid; blank records count and may fail width checks.
Text cannot recover original byte encoding. BOM removed; replacement characters/NUL and unpaired surrogates flagged, not repaired. No email-deliverability or business-truth validation. No URL fetching, Excel binary, automatic repair or monitoring.
**Apify stores your input with the run.** Upload sensitive tables only under your policy and manage run storage accordingly. This tool does not anonymize uploaded data.

### Free tool

Developer surcharge **0**. Apify compute/storage/transfer still uses your allowance; free usage is not unlimited. No earnings or business outcome promised.

### Local use

Python 3.12, standard library for local checks:

```sh
python -m src.main --local INPUT.json --output report.json
python -m unittest -v test_product
```

Cloud uses Apify SDK 3.x only for run input/output. Validation does not call network or AI.

# Actor input Schema

## `csvText` (type: `string`):

Paste CSV, up to 1 MiB UTF-8. Header is logical record 1. Input persists in your run.

## `delimiter` (type: `string`):

Exactly one separator character other than quote or newline.

## `requiredColumns` (type: `array`):

Exact column names, values must not be blank.

## `keyColumns` (type: `array`):

Exact column names for a tuple key. Empty keys separate, no key inferred.

## Actor input object example

```json
{
  "csvText": "id,email,amount\n1,ada@example.com,10\n1,,=SUM(A1)\n3,bob@example.com,-5\n",
  "delimiter": ",",
  "requiredColumns": [],
  "keyColumns": []
}
```

# Actor output Schema

## `report` (type: `string`):

No description

## `issues` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "csvText": `id,email,amount
1,ada@example.com,10
1,,=SUM(A1)
3,bob@example.com,-5`
};

// Run the Actor and wait for it to finish
const run = await client.actor("globose_keypress_hwl/csv-quality-report").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "csvText": """id,email,amount
1,ada@example.com,10
1,,=SUM(A1)
3,bob@example.com,-5
""" }

# Run the Actor and wait for it to finish
run = client.actor("globose_keypress_hwl/csv-quality-report").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "csvText": "id,email,amount\\n1,ada@example.com,10\\n1,,=SUM(A1)\\n3,bob@example.com,-5\\n"
}' |
apify call globose_keypress_hwl/csv-quality-report --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,globose_keypress_hwl/csv-quality-report"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/V8GrcLzqKUY0wLsXO/builds/CmO5M1o8vToEjwYq1/openapi.json
