cook-extract
v0.0.1
Published
Structured data extraction CLI for generic PDF documents via LLMs
Maintainers
Readme
Cook Extract (cook-extract)
An automated CLI tool meant to securely scan, download, and extract structured data schemas from generic PDF documents hosted on Google Drive using LLMs (OpenAI or Cohere) and export the cleanly parsed results securely to a CSV file.
🚀 Features
- Interactive Global CLI (
cex): Easily runcex extractglobally from any repository setup. - Unified Configuration: Use
cex configto establish custom structural outputs natively mapped alongside your preferred AI fallback models. - Google Drive Integration: Quickly streams public folder links bypassing Auth friction setups seamlessly.
- LLM-Powered Extraction:
- Supports OpenAI (GPT-4o) and Cohere (Command R+).
- Built-in concurrency control safely regulating LLM payload executions against aggressive rate limits.
- Robust Exports: Generates cleaned CSV reports mapping to dynamic user-generated configurations securely.
- Clean Workspace: Automatically manages and removes temporary download folders.
🛠️ Tech Stack
- Runtime: Node.js (ESM)
- Language: TypeScript
- CLI Framework: Commander.js & Inquirer.js
- Google APIs: googleapis & @google-cloud/local-auth
- PDF Parsing: pdf-parse
- LLM Clients: openai & cohere-ai
- Utilities: p-limit, dotenv, cli-progress, csv-writer
📋 Prerequisites
- Google Drive Link:
- Ensure the folders you want to scan are publicly accessible as "Anyone with the link can view".
- LLM API Keys:
- Acquire an OpenAI or Cohere secure token directly from their platforms.
⚙️ Installation
# Install dependencies
npm install
# Link the package globally to enable the 'cex' command securely
npm run build
npm link🔐 Configuration
Deploy the interactive configuration editor securely globally:
cex configConfigure your extraction schema fields alongside your selected LLM_PROVIDER natively bypassing legacy .env requirements cleanly!
📖 Usage
Run the core extractor straight from the terminal wherever you please:
cex extract- Select Data Source: Default target points to Google Drive.
- Enter Drive Link: Provide the public shared folder URL.
- Choose Output Path: Defaults to
./results.csv.
The tool will seamlessly:
- Download all contained PDFs directly parsing texts dynamically.
- Interface with the LLM mapping structurally against your defined schema keys.
- Write a clean CSV linking each row explicitly back to viewing URLs securely.
