alibabacloud-docmind-parse

aliyun/alibabacloud-aiops-skills

Интеллектуальный разбор документов DocMind в Markdown/JSON/HTML.

Звёзды298
Форки40
Авторaliyun
Обновлённоя 18 2026

Установка

SKILL.md

DocMind Document Parsing

Two Invocation Modes

  1. Free Mode (V2 API Direct): Configure the endpoint via the DOCMIND_V2_ENDPOINT environment variable; limited daily free quota.
  2. Alibaba Cloud POP Mode: Credentials are obtained automatically through the default credential chain; 3,000 pages per month free, pay-as-you-go beyond that.

Routing Strategy

  • When the Alibaba Cloud default credential chain is available, prefer POP Mode.
  • When credentials are unavailable but DOCMIND_V2_ENDPOINT is configured, use V2 Free Mode.
  • When the free quota is exhausted, prompt the user to activate the Alibaba Cloud DocMind service.

Environment Variables

VariableDescriptionRequired
DOCMIND_V2_ENDPOINTV2 API service endpoint (domain or IP). Defaults to docmind.aliyuncs.comOptional

POP Mode automatically obtains credentials through the Alibaba Cloud default credential chain (environment variables, config files, ECS RAM roles, etc.) — no manual management needed.


Usage

python scripts/docmind_parse.py <file_path_or_url> [options]

Parameters

ParameterDescriptionDefault
<file_path_or_url>Local file path or file URLRequired
--modeInvocation mode: auto, v2, popauto
--enhancementEnhancement mode: VLM, LLM, DIGITAL, OCR, AUTONone
--outputOutput format: markdown, json, htmlmarkdown
--pagesPage range to parse, e.g. 1-5All
--output-fileOutput file pathStdout
--head-footParse headers and footersOff
--user-promptCustom user promptNone
--optionDocument parsing optionsNone
--markdown-tableTable output format: html, markdownNone
--markdown-imageImage output format: html, markdownNone
--file-extFile extension (alternative to fileName)Auto-detected

Examples

# Parse a URL (auto-select mode)
python scripts/docmind_parse.py https://example.com/doc.pdf

# Parse with VLM enhancement
python scripts/docmind_parse.py https://example.com/doc.pdf --enhancement VLM

# Parse the first 5 pages, output to a Markdown file
python scripts/docmind_parse.py ./report.pdf --pages 1-5 --output-file result.md

# Parse a local file via V2 mode (auto base64 encoding)
python scripts/docmind_parse.py ./contract.pdf --mode v2

# Parse with custom table/image output formats
python scripts/docmind_parse.py https://example.com/doc.pdf --markdown-table markdown --markdown-image html

# Parse headers and footers with a custom prompt
python scripts/docmind_parse.py https://example.com/doc.pdf --head-foot --user-prompt "Extract all footnotes"

# Force Alibaba Cloud POP mode
python scripts/docmind_parse.py ./contract.pdf --mode pop

V2 API Direct Access (Free Mode)

Supports both URL and local file (base64) upload. The request body is organized into four blocks: Document, Processing, Output, and Notification.

Submit Endpoint

POST {DOCMIND_V2_ENDPOINT}/skill/submit

Full request schema:

{
  "document": {
    "fileUrl": "https://example.com/doc.pdf",
    "fileBase64": "<base64-encoded file content, alternative to fileUrl>",
    "fileName": "doc.pdf",
    "fileNameExtension": "pdf"
  },
  "processing": {
    "enhancementMode": "VLM",
    "pageIndex": "1-5",
    "headFoot": false,
    "userPrompt": "Custom prompt",
    "option": "parsing-option"
  },
  "output": {
    "outputFormat": ["markdown"],
    "markdownTable": ["html"],
    "markdownImage": ["html"],
    "docExtraParameters": {"key": "value"},
    "extraParameters": "audio-video-extra-params",
    "ossConfig": {
      "bucket": "my-bucket",
      "endpoint": "oss-cn-hangzhou.aliyuncs.com",
      "accessKeyId": "...",
      "accessKeySecret": "...",
      "securityToken": "..."
    }
  },
  "notification": {
    "enableEventCallback": false
  }
}

document.fileUrl and document.fileBase64 are mutually exclusive. When parsing a local file via V2 mode, the script automatically reads and base64-encodes the file. fileNameExtension is auto-detected from the file extension when not explicitly provided.

Response:

{
  "success": true,
  "data": { "bizId": "docmind-20260519-xxxx" }
}

Query Endpoint

POST {DOCMIND_V2_ENDPOINT}/skill/query

{
  "bizId": "docmind-20260519-xxxx",
  "layoutStepSize": 100,
  "layoutNum": 0
}

Response (on success):

{
  "success": true,
  "data": {
    "status": "success",
    "processing": 100.0,
    "layouts": [ ... ]
  }
}

Rate limiting: max 5 tasks per second per IP, global limit 20.


Alibaba Cloud POP Invocation

Three-step async workflow using the default credential chain to initialize the client:

  1. Submit task - SubmitDocParserJob / SubmitDocParserJobAdvance
  2. Query status - QueryDocParserStatus (poll until success/fail)
  3. Get result - GetDocParserResult (incremental retrieval via LayoutNum + LayoutStepSize pagination)

POP endpoint: docmind-api.cn-hangzhou.aliyuncs.com, API version: 2022-07-11

from alibabacloud_credentials.client import Client as CredClient
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_docmind_api20220711.client import Client as DocMindClient

cred = CredClient()
config = open_api_models.Config(
    credential=cred,
    endpoint="docmind-api.cn-hangzhou.aliyuncs.com",
    user_agent="AlibabaCloud-Agent-Skills/alibabacloud-docmind-parse/" + os.environ.get("SKILL_SESSION_ID", "unknown")
)
client = DocMindClient(config)

Quota

ModeFree QuotaAfter Exhaustion
V2 API DirectLimited daily quotaPrompt to activate Alibaba Cloud service
Alibaba Cloud POP3,000 pages/monthAutomatic pay-as-you-go

When quota is exhausted, prompt the user to visit https://docmind.console.aliyun.com/doc-overview to activate the service.


Error Handling

Error CodeMeaningResolution
QuotaExhausted / ThrottlingQuota exhausted or rate-limitedPrompt to activate Alibaba Cloud service
FileUrlLegalInvalid file URLVerify the URL is publicly accessible
InvalidFileFormatUnsupported file formatShow the list of supported formats
FileSizeExceededFile too largeV2 limit 5 MB, POP limit 150 MB
OssAccessDeniedError / HTTP 403URL points to a private or restricted OSS resourceSee pre-validation rules below

Pre-validation and Exception Handling

Before invoking the script, the Agent MUST perform the following checks:

  1. Local file path validation: If the input is a local file path, verify that the file exists and is readable before calling the script. If the file does not exist, stop immediately and ask the user to verify the path. The Agent must NEVER create, fabricate, or substitute a file to bypass a missing-file error.

  2. Private URL detection: If the input is a URL and V2 mode returns OssAccessDeniedError or HTTP 403, the URL is likely private or requires authentication. In this case:

    • Inform the user that the URL is not publicly accessible.
    • Ask the user to either provide a publicly accessible URL, or download the file locally and re-run with the local path — the script will automatically encode it as base64 and upload via V2 (--mode v2 handles base64 encoding transparently).
  3. Network unreachable: If the script fails with a connection error (e.g. ConnectionError, ConnectionRefused), check that:

    • The DOCMIND_V2_ENDPOINT (default docmind.aliyuncs.com) is reachable from the current environment.
    • Proxy settings or firewall rules are not blocking outbound HTTPS traffic.

Supported File Formats

  • Documents: PDF, Word (doc/docx), PPT (ppt/pptx), Excel (xls/xlsx/xlsm)
  • Images: JPG, JPEG, PNG, BMP, GIF
  • Other: Markdown, HTML, EPUB, MOBI, RTF, TXT
  • Audio/Video (POP mode only): MP4, MKV, AVI, MOV, WMV, MP3, WAV, AAC

Output Formats

Markdown Output

Each layout block's markdownContent field is concatenated; tables are embedded as HTML tables.

JSON Output

Raw layouts structured data, including type/subType, text, markdownContent, pageNum, index, pos and other fields.


Observability

All outbound HTTP requests (V2 API and Alibaba Cloud POP SDK) set the following User-Agent header:

AlibabaCloud-Agent-Skills/alibabacloud-docmind-parse/{session-id}

The {session-id} segment is read from the SKILL_SESSION_ID environment variable at runtime. If the variable is not set, the value falls back to unknown.

ComponentValue
UA templateAlibabaCloud-Agent-Skills/alibabacloud-docmind-parse/{session-id}
session-id sourceSKILL_SESSION_ID env var
Fallbackunknown
Env var exampleexport SKILL_SESSION_ID=agent-abc123-session-xyz

All skill invocations sharing the same SKILL_SESSION_ID value are correlated as a single session in server-side logs.


Dependency Installation

# POP mode
pip install "alibabacloud-docmind-api20220711>=1.0.0" \
            "alibabacloud-credentials>=1.0.0" \
            "alibabacloud-tea-openapi>=0.3.8" \
            "alibabacloud-tea-util>=0.3.0" \
            "alibabacloud-gateway-pop>=0.1.0"

# V2 mode
pip install "requests>=2.20.0"

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: alibabacloud-docmind-parse](https://darkplay.ru/ai/skills/aliyun-alibabacloud-aiops-skills-alibabacloud-docmind-parse)

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

Requirement Parsershanraisshan · Анализирует описания запросов функций и извлекает требования, цели, ограничения и…
61 912 ★
kyc-screeneranthropics · Разбирает документы онбординга, запускает движок правил, отмечает пробелы
186 комп.
markdown-html-skillsalirezarezvani · Конвертация markdown в интерактивный HTML: 5 навыков, включая конвертер слайдов.
510 комп.
burpsuite-project-parsertrailofbits · Поиск и извлечение данных из файлов проектов Burp Suite (.burp) для анализа безопасности.
122 комп.
agent-trace-triageanthropics · Плагин Claude Code для разработчиков агентных ИИ-систем. Помогает разбирать сбои запусков…
38 комп.
artillery-mcpanthropics · Нагрузочное тестирование Artillery 2.x через MCP: сервер с 18 инструментами и навык для…
38 комп.
claude-anti-memanthropics · Помогает бороться с типичными ошибками Claude: выдуманными методами библиотек, лишним…
38 комп.
claude-code-el-sendgridanthropics · Источник входящих писем SendGrid для плагина el: письма как фоновые события в Claude Code.
38 комп.
code-parseranthropics · Индексирует код Dart, Python и TypeScript, сокращая расход токенов LLM на 70–97%.
38 комп.
ido4specsanthropics · Разбивает спецификацию на задачи GitHub с оценкой усилий, рисков и зависимостей.
38 комп.

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации изображений

Генерация изображений

Подборка нейросетей для генерации изображений от фотореализма до концепт-арта. Сервисы, которые экономят часы ручной работы, создавая визуал для блогов, рекламы и дизайна за минуты

MagviMagvi
По запросу
5.0
DALL-E 3OpenAI
По подписке
5.0
SupaLabSupalab
По запросу
5.0
Freestyling.aiFreestyling
Есть бесплатный тариф
4.9
ArtGeneration.meArtgeneration
Есть бесплатный тариф
4.9
BigjpgBigjpg
По запросу
4.9
Художник от VKVK
Бесплатно
4.9
Wonderink — ИИ-книги
Есть бесплатный тариф
4.8
Avato AI12ai
По запросу
4.8
Virton AIVirton
По запросу
4.8