AgentPM™

@zack/table-extract

Extract structured tables from HTML or CSV sources into normalized rows and columns.

Install
agentpm install @zack/table-extract@0.1.0
Load
Weekly downloads
1
0%
Last publish
1d ago
v0.1.0
agent.json
{
  "name": "table-extract",
  "version": "0.1.0",
  "description": "Extract structured tables from HTML or CSV sources into normalized rows and columns.",
  "files": [
    "table_extract/"
  ],
  "entrypoint": {
    "args": [
      "-u",
      "table_extract/__main__.py"
    ],
    "command": "python",
    "timeout_ms": 30000
  },
  "inputs": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "description": "Optional local file path containing HTML or CSV content."
      },
      "csv_text": {
        "type": "string",
        "description": "Optional raw CSV content to treat as a single table."
      },
      "html_text": {
        "type": "string",
        "description": "Optional raw HTML content to extract tables from."
      },
      "header_row": {
        "type": "boolean",
        "default": true,
        "description": "Whether the first row should be treated as the header."
      },
      "source_type": {
        "enum": [
          "auto",
          "html",
          "csv"
        ],
        "type": "string",
        "default": "auto",
        "description": "Source type to extract tables from."
      },
      "table_index": {
        "type": "integer",
        "default": 0,
        "minimum": 0,
        "description": "Zero-based HTML table index to return when multiple tables are present."
      }
    },
    "additionalProperties": false
  },
  "outputs": {
    "oneOf": [
      {
        "type": "object",
        "required": [
          "ok",
          "tables",
          "detected_count",
          "warnings",
          "metadata"
        ],
        "properties": {
          "ok": {
            "const": true,
            "description": "True when table extraction succeeded."
          },
          "tables": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One extracted table with columns and rows.",
              "additionalProperties": true
            },
            "description": "Extracted tables in normalized form."
          },
          "metadata": {
            "type": "object",
            "description": "Summary metadata about the extraction.",
            "additionalProperties": true
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "One warning message."
            },
            "description": "Warnings encountered during extraction."
          },
          "detected_count": {
            "type": "integer",
            "description": "Number of tables detected in the source."
          }
        },
        "additionalProperties": false
      },
      {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false,
            "description": "False when validation or extraction failed."
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation of the failure."
              }
            },
            "description": "Structured error returned by the tool.",
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      }
    ]
  },
  "readme": "README.md",
  "license": {
    "spdx": "MIT"
  },
  "runtime": {
    "type": "python",
    "version": "3.11"
  }
}
Compatibility
NodePython