360 Secure SkillHub
360 安全技能中心

Doc Format Converter

支持 CSV、Excel、JSON、PDF、Markdown、DOCX、HTML、PNG/JPG、TXT 之间的批量格式转换,按来源与目标格式配对处理,含编码自动识别与损坏文件跳过。提供免费额度与按次计费模式,PRO 含 AI 自定义字段重命名、PDF OCR 与飞书结果推送;计费依赖外部服务与相应环境变量。

billjamno58
billjamno58
热度 27.62
最近更新 2026-05-20 03:37:20
分类:效率依赖:代码执行 / 读写文件 / 第三方 API / 内部调用大模型应用场景:文件转换 / 数据处理 / 工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add doc-format-converter
Metadata
name
doc-format-converter
description
Doc Format Converter — Convert between CSV, Excel, JSON, PDF, Markdown, DOCX, HTML, and images with one click. Batch processing supported. Triggers: format conversion, batch convert, file converter, CSV to Excel, Excel to JSON, PDF to image, convert files
override-tools
[]

Doc Format Converter

Batch file format conversion: CSV ↔ Excel ↔ JSON ↔ PDF / Markdown / DOCX / HTML / PNG / TXT — one-click batch conversion.


Features Overview

Feature Description
Multi-format CSV, Excel, JSON, PDF, Markdown, DOCX, HTML, PNG/JPG, TXT
Batch Processing Convert multiple files in one execution
AI Custom Conversion Rename fields, extract tables, restructure data (PRO)
Feishu Integration Conversion complete → Feishu card notification

Supported Conversions

Source Targets
CSV Excel (.xlsx), JSON
Excel (.xlsx/.xls) JSON, CSV, PNG (table image)
JSON Excel (multi-sheet)
Markdown DOCX, HTML
DOCX Markdown
HTML Markdown
PDF PNG/JPG (image)
Image (PNG/JPG) PDF
TXT CSV

Tiered Features

Feature FREE PRO
Total files 10 (lifetime) Unlimited
Batch size 5 files Unlimited
Formats Basic All
AI custom conversion — Yes
PDF OCR — Yes
Feishu result push — Yes

Technical Implementation

Category Technology
Spreadsheet pandas (CSV/Excel/JSON)
PDF PyMuPDF + pdfplumber
Document pandoc + python-docx
Image Pillow (PIL)
Encoding UTF-8/GBK/ISO auto-detect

Usage

Standard Conversion

Convert these files:
[upload file list]
Target format: XLSX

AI Custom Conversion (PRO)

Rename fields in this CSV to English, then convert to JSON
Extract tables from this DOCX into Excel, convert other content to Markdown

Core Script

See scripts/converter.py for full implementation:

from scripts.converter import batch_convert, check_quota_free

# Free tier: check before converting
can_proceed, msg = check_quota_free(remaining=7)
if not can_proceed:
    print(msg)
    sys.exit(1)

# Batch conversion
results = batch_convert(
    file_paths=["data.csv", "report.xlsx"],
    target_format="json",
    output_dir="/tmp/output",
    plan="FREE",
)
print(results)

Billing

  • Pay-per-call: $0.0100 USDT per execution via SkillPay.me
  • Balance insufficient: Payment URL returned — user tops up at https://skillpay.me/doc-format-converter
  • External data flow: FEISHU_USER_ID transmitted to skillpay.me/api/v1/billing for billing identification
  • Billing model: Each batch conversion run = 1 call = $0.0100 USDT

Required Environment Variables

Variable Description
FEISHU_USER_ID User open_id for billing (passed by Feishu runtime)
SKILL_BILLING_API_KEY SkillPay Builder API Key
SKILL_BILLING_SKILL_ID SkillPay Skill ID (defaults to doc-format-converter)

Error Handling

Error Type Handling
Encoding error Auto-try UTF-8 → GBK → ISO-8859-1
Unsupported format Friendly error + suggested formats
Corrupted file Skip and report, continue to next
Quota exceeded Card prompts upgrade option