CSV sum integers
csv-sum-integers · version 1.0.0 · CSV & tables · free, no key needed
Sum a CSV column of strict signed base-10 integer strings using BigInt.
Use when you need to: csv sum integers · sum csv integer column.
Supported
- csv sum integers
- sum csv integer column
Not supported
- floats
- ignore empty
- currency
- average
Behavior
- Reuse baseline CSV parser and limits.
- Canonical signed base-10 integer strings: /^-?(0|[1-9][0-9]*)$/.
- Reject leading zeros, plus signs, spaces, decimals, exponents, hex, empty, and -0.
- At most 256 digits excluding the sign. Compute with BigInt. Never return JSON BigInt.
- Canonical output is the same form; 0 is "0".
- Every data cell in column must be a canonical integer string. Empty cells are invalid.
- No rows -> invalid_input.
- sum is a canonical integer string. rows_used equals rows_in.
Input
csv(string, required): max length 256000column(string, required): min length 1; max length 256
Output
sum(string, required)rows_used(integer, required)
Limits
- max input bytes: 256000
- max data rows: 5000
- max integer digits: 256
Example
Request input:
{
"csv": "n\n1\n-2\n10\n",
"column": "n"
}
Response:
{
"result": {
"sum": "9",
"rows_used": 3
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "csv-sum-integers",
"version": "1.0.0",
"input": {
"csv": "n\n1\n-2\n10\n",
"column": "n"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/csv-sum-integers/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"csv":"n\n1\n-2\n10\n","column":"n"}'
The machine-readable contract is at /v1/tools/csv-sum-integers/versions/1.0.0.
CLI
node cli.mjs run csv-sum-integers 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- CSV abs integer column: Replace every data cell in a named CSV column with the absolute value of a canonical integer.
- CSV clamp integer column: Clamp every data cell in a named CSV column to optional canonical integer min and max bounds.
- CSV min max integers: Minimum and maximum of a CSV column of strict signed base-10 integer strings.
- CSV scale integer column: Multiply every data cell in a named CSV column by a canonical integer factor.
- CSV distinct values: List distinct exact values of one CSV column in first-seen order.
- CSV filter equals: Keep CSV data rows whose named column equals an exact string.