← 返回 Skills 市场
besteva77

File Converter

作者 Besteva77 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
92
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install besteva-file-converter
功能描述
This skill provides comprehensive file format conversion capabilities. It should be used when users need to convert files between different formats, includin...
使用说明 (SKILL.md)

\r \r

File Converter Skill\r

\r A comprehensive file format conversion toolkit supporting documents, images, and spreadsheets.\r \r

When to Use\r

\r Activate this skill when any of these scenarios occur:\r \r

  • Document conversion: User wants to convert between PDF and Word formats\r
  • Image conversion: User needs images in a different format (PNG→JPG, JPG→WebP, etc.)\r
  • Spreadsheet conversion: User needs to exchange data between Excel and CSV\r
  • Batch operations: User has multiple files that need converting at once\r
  • Format queries: User asks about supported formats or how to convert specific file types\r \r

Supported Conversions\r

\r | Source Format | Target Format | Script | Notes |\r |--------------|---------------|--------|-------|\r | .pdf | .docx | scripts/pdf_to_word.py | Extracts text, tables, layout |\r | .docx, .doc | .pdf | scripts/word_to_pdf.py | Requires MS Word on Windows |\r | PNG/JPEG/WebP/BMP/GIF/TIFF | Any other image format | scripts/image_converter.py | Quality control, resize support |\r | .csv | .xlsx | scripts/excel_csv_converter.py | Custom delimiter/encoding |\r | .xlsx, .xls | .csv | scripts/excel_csv_converter.py | Multi-sheet support |\r \r

Prerequisites\r

\r

Python Dependencies\r

\r Install required packages before first use:\r \r

pip install Pillow pdf2docx docx2pdf openpyxl xlrd\r
```\r
\r
**Quick install command:**\r
```bash\r
pip install Pillow pdf2docx docx2pdf openpyxl xlrd\r
```\r
\r
### Platform-Specific Requirements\r
\r
- **Word → PDF (Windows)**: Microsoft Word must be installed (`docx2pdf` uses COM automation)\r
- **PDF → Word**: No external software required; uses `pdf2docx`\r
- **Image conversion**: Uses `Pillow` only, works on all platforms\r
\r
## Workflow Guidelines\r
\r
### Step 1: Identify Conversion Type\r
\r
Determine what the user wants to convert:\r
\r
```\r
User says "convert this PDF"        → PDF to Word\r
User says "turn this into PDF"       → Word to PDF  \r
User says "change this PNG to JPG"   → Image conversion\r
User says "export this Excel as CSV" → Excel to CSV\r
```\r
\r
### Step 2: Check Dependencies\r
\r
Before running any script, verify required packages are installed:\r
\r
```bash\r
python -c "import PIL; import pdf2docx; import docx2pdf; import openpyxl"\r
```\r
\r
If imports fail, prompt user to run:\r
```bash\r
pip install Pillow pdf2docx docx2pdf openpyxl xlrd\r
```\r
\r
### Step 3: Execute Appropriate Script\r
\r
#### PDF → Word\r
\r
**Single file:**\r
```bash\r
python scripts/pdf_to_word.py \x3Cinput.pdf> [output.docx]\r
```\r
\r
**Batch mode:**\r
```bash\r
python scripts/pdf_to_word.py --batch ./pdf_folder --output-dir ./output_folder\r
```\r
\r
**Options:**\r
- `--start N`: Start from page N (default: 0)\r
- `--end N`: End at page N (default: all pages)\r
\r
#### Word → PDF\r
\r
**Single file:**\r
```bash\r
python scripts/word_to_pdf.py \x3Cinput.docx> [output.pdf]\r
```\r
\r
**Batch mode:**\r
```bash\r
python scripts/word_to_pdf.py --batch ./docs_folder --output-dir ./pdfs_folder\r
```\r
\r
**Check requirements:**\r
```bash\r
python scripts/word_to_pdf.py --check\r
```\r
\r
#### Image Format Conversion\r
\r
**Single file:**\r
```bash\r
python scripts/image_converter.py \x3Cinput_image> --format \x3Ctarget_format>\r
```\r
\r
**Batch mode:**\r
```bash\r
python scripts/image_converter.py --batch ./images_dir --format webp --output-dir ./webp_dir\r
```\r
\r
**Target formats:** `png`, `jpg`/`jpeg`, `webp`, `bmp`, `gif`, `tiff`/`tif`\r
\r
**Options:**\r
- `-q/--quality N`: Quality for lossy formats (1-100, default: 95)\r
- `--resize WIDTH HEIGHT`: Resize dimensions\r
- `--no-optimize`: Disable optimization\r
- `--info`: Display image info without converting\r
\r
**Examples:**\r
```bash\r
# High-quality JPEG compression\r
python scripts/image_converter.py photo.png --format jpg -q 90\r
\r
# Convert to WebP with smaller size\r
python scripts/image_converter.py photo.png --format webp -q 80\r
\r
# Resize while converting\r
python scripts/image_converter.py large.png --format jpg --resize 1920 1080\r
\r
# View image info\r
python scripts/image_converter.py image.png --info\r
```\r
\r
#### Excel ↔ CSV\r
\r
**CSV → Excel:**\r
```bash\r
python scripts/excel_csv_converter.py data.csv --format xlsx [options]\r
```\r
\r
**Excel → CSV:**\r
```bash\r
python scripts/excel_csv_converter.py data.xlsx --format csv [options]\r
```\r
\r
**Batch mode:**\r
```bash\r
python scripts/excel_csv_converter.py --batch ./data_dir --format csv\r
```\r
\r
**Options:**\r
- `-d/--delimiter CHAR`: Custom separator (default: comma)\r
- `-e/--encoding ENC`: File encoding (default: utf-8)\r
- `--sheet NAME`: Specific sheet name (Excel→CSV)\r
- `--sheet-name NAME`: Output sheet name (CSV→Excel)\r
- `--no-header`: Skip header row\r
- `--info`: Show Excel structure info\r
\r
**Examples:**\r
```bash\r
# European-style CSV (semicolon delimited)  \r
python scripts/excel_csv_converter.py data.csv --format xlsx -d ";"\r
\r
# Chinese encoding support\r
python scripts/excel_csv_converter.py data.xlsx --format csv -e gbk\r
\r
# Export specific sheet\r
python scripts/excel_csv_converter.py workbook.xlsx --format csv -s "Sales Report"\r
\r
# View Excel info\r
python scripts/excel_csv_converter.py data.xlsx --info\r
```\r
\r
### Step 4: Verify Results\r
\r
After each conversion:\r
\r
1. Confirm output file(s) exist at expected location(s)\r
2. Report file sizes to user (original vs converted)\r
3. For batch operations, report success count vs total count\r
4. If errors occurred, summarize them clearly\r
\r
## Error Handling\r
\r
### Common Issues and Solutions\r
\r
| Error | Cause | Solution |\r
|-------|-------|----------|\r
| `ModuleNotFoundError` | Missing package | Run `pip install \x3Cpackage>` |\r
| `COMError` (Word→PDF) | MS Word not installed | Install MS Office or use alternative |\r
| `UnicodeDecodeError` | Wrong encoding | Specify correct `--encoding` |\r
| `FileNotFoundError` | Wrong path | Verify input path is absolute or relative correctly |\r
| Permission denied | Read-only directory | Use writable output directory |\r
\r
### Encoding Guide\r
\r
When dealing with non-UTF-8 files, common encodings:\r
- Chinese Windows: `gbk` / `gb18030`\r
- Western Europe: `latin-1` / `cp1252`\r
- Japanese: `shift-jis` / `cp932`\r
- Auto-detect: Try `utf-8` first, then fallback\r
\r
## Best Practices\r
\r
1. **Always use absolute paths** when calling scripts to avoid path confusion\r
2. **Create output directories** before batch operations if they don't exist\r
3. **Check dependencies once** at start of session, not before every call\r
4. **Report results clearly** with file paths, sizes, and success/failure counts\r
5. **Handle transparency** appropriately — JPEG doesn't support alpha channels\r
6. **Preserve quality** defaults are high (95%) but adjust based on use case\r
安全使用建议
This skill appears coherent and performs local file conversions using the bundled Python scripts. Before running: (1) review the provided scripts if you can (they operate on local files and do not call the network), (2) be prepared to pip-install the listed Python packages (Pillow, pdf2docx, docx2pdf, openpyxl, xlrd), and (3) run conversions on non-sensitive sample files first — note some minor bugs/typos exist in the code which may cause errors, so consider running inside a sandbox or virtual environment and back up important files before batch operations.
功能分析
Type: OpenClaw Skill Name: besteva-file-converter Version: 1.0.0 The skill bundle provides a comprehensive set of file conversion utilities for images, PDFs, and spreadsheets using standard Python libraries such as Pillow, pdf2docx, and openpyxl. The scripts (e.g., convert_image.py, convert_pdf.py, and excel_csv_converter.py) follow expected logic for file processing, lack network connectivity, and do not attempt to access sensitive system files or exfiltrate data. Although there is a minor typo in scripts/convert_image.py (st_stize) and some redundancy between scripts, these appear to be unintentional development flaws rather than malicious intent.
能力评估
Purpose & Capability
Name/description (file conversions) match the included scripts (PDF↔Word, Word→PDF, image conversions, Excel↔CSV). Required capabilities are local file I/O and the Python imaging/office libraries listed in SKILL.md — nothing extraneous (no cloud/API credentials or unrelated system access) is requested.
Instruction Scope
SKILL.md instructs the agent/user to run the included Python scripts and to check/install specific Python packages. The instructions focus on processing user-supplied files and reporting results; they do not direct the agent to read unrelated system files, environment variables, or to transmit data off the machine.
Install Mechanism
There is no formal install spec (instruction-only), but the skill bundle contains executable Python scripts that will run locally. SKILL.md asks the user to pip-install dependencies; this is typical but means code execution depends on locally installed packages. No external downloads or obscure install URLs are used.
Credentials
The skill declares no required environment variables or credentials. The scripts operate on local files and attempt only to detect local MS Word installations (Windows) for docx->PDF conversion; this is proportionate to the stated functionality.
Persistence & Privilege
always is false and the skill does not request persistent/system-wide privileges or attempt to modify other skills. Autonomous invocation is allowed (platform default) but not combined with any broad credential access.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install besteva-file-converter
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /besteva-file-converter 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release with comprehensive file format conversion features: - Supports conversion between PDF ↔ Word, various image formats (PNG/JPG/WebP/BMP/GIF/TIFF), and Excel ↔ CSV. - Enables both single-file and batch processing workflows. - Provides clear usage instructions, script examples, and options for quality, resizing, encoding, and sheet selection. - Includes troubleshooting tips for dependency issues, encoding, and file access errors. - Details best practices for robust, reliable file conversions.
元数据
Slug besteva-file-converter
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

File Converter 是什么?

This skill provides comprehensive file format conversion capabilities. It should be used when users need to convert files between different formats, includin... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 92 次。

如何安装 File Converter?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install besteva-file-converter」即可一键安装,无需额外配置。

File Converter 是免费的吗?

是的,File Converter 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

File Converter 支持哪些平台?

File Converter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 File Converter?

由 Besteva77(@besteva77)开发并维护,当前版本 v1.0.0。

💬 留言讨论