oidlabs-com/lexoid/lexoid-python
Claude Code and agent skill by oidlabs-com/lexoid
- community
Checking that the SKILL.md file is still in the repository.
Parse and convert documents (PDFs, images, web pages, DOCX/XLSX/PPTX, audio) inside a Python program using the `lexoid` library. Use when the user is writing Python code that needs to extract markdown from documents, run schema-constrained extraction, convert files to LaTeX, get bounding boxes, recursively crawl URLs, or integrate document parsing into a larger pipeline. Triggers include `from lexoid` imports, "use lexoid in Python", "parse PDFs programmatically", "extract structured data with a Pydantic/dataclass schema", or any request to embed parsing into a Python app/notebook.
Install
npx vskill@latest install oidlabs-com/lexoid/lexoid-pythonSKILL.md
Lexoid Python API
Lexoid's Python API is the right choice whenever the user is writing Python — notebooks, services, batch pipelines, or anything that needs the parsed result as a Python dict/list. For shell one-offs, use the lexoid-cli skill instead.
When to use this skill
- The user is writing Python and wants to parse PDFs, images, URLs, DOCX/XLSX/PPTX, audio, or text-format files.
- The user needs per-page segments, token usage, parser metadata, or bounding boxes in code.
- The user wants schema-based structured extraction (
dict,dataclass, or PydanticBaseModel). - The user is integrating parsing into a larger app (Streamlit, FastAPI, RAG pipeline, etc.).
Setup checks
Before writing code, confirm:
lexoidis installed (pip install lexoid).- Required API key env vars are set for the chosen provider (see below).
- For Linux DOCX → PDF conversion, LibreOffice (
lowriter) is on PATH. - For
api_provider="ollama": anollama serveprocess is running atOLLAMA_BASE_URL(defaulthttp://localhost:11434) and the target model has been pulled withollama pull <model>. - For
api_provider="local"(SmolDocling/granite-docling, PaddleOCR-VL): no server needed — these models run in-process viatransformers/ PaddleOCR. The first call downloads weights from Hugging Face, so the host needs network access (or pre-cached weights) and enough disk/RAM/GPU for the chosen model.
API keys by provider:
| Provider | Env var | |
|---|---|---|
gemini | GOOGLE_API_KEY | |
openai | OPENAI_API_KEY | |
anthropic | ANTHROPIC_API_KEY | |
mistral | MISTRAL_API_KEY | |
huggingface | HUGGINGFACEHUB_API_TOKEN | |
together | TOGETHER_API_KEY | |
openrouter | OPENROUTER_API_KEY | |
fireworks | FIREWORKS_API_KEY | |
ollama | none (uses OLLAMA_BASE_URL) | |
local | none |
Loading API keys from .env
Lexoid reads API keys from the process environment; it does not load a .env file on its own. When keys live in a project .env, load them before calling any LLM-based API (LLM_PARSE, parse_with_schema, parse_to_latex, or AUTO when it routes to an LLM). python-dotenv ships as a Lexoid dependency, so it is already available:
Call load_dotenv() once at program/notebook startup, before the first parse(...) call. If the keys are already exported in the environment, this step is unnecessary (and harmless).
Public API
Four entry points in lexoid.api:
parse(path, parser_type="AUTO", pages_per_split=4, max_processes=4, **kwargs)— main function. Returns a dict.parse_with_schema(path, schema, api=None, model="gpt-4o-mini", **kwargs)— structured JSON extraction. Returns a Python list whose shape depends on the mode and the model's output (see "Schema return shape" below).parse_to_latex(path, api=None, model="gpt-4o-mini", **kwargs)— returns a LaTeX string.parse_chunk(path, parser_type, **kwargs)— low-level single-chunk parser; users rarely need this.
ParserType enum: LLM_PARSE, STATIC_PARSE, AUTO.
parse() return shape
For URL inputs that resolve to HTML (no .pdf/image extension, and as_pdf=False), parse() short-circuits to recursive_read_html(), which returns only raw, segments, title, url, parent_title, and recursive_docs. Code that always reads result["token_usage"] or result["parsers_used"] will KeyError on that path — use .get(...) or guard with if "token_usage" in result.
Common recipes
Basic parsing
Choose a parser explicitly
AUTO routing with a priority
Local inference (no API key)
Schema-based structured extraction
Schema return shape
parse_with_schema returns a Python list. The exact shape depends on the mode and on what JSON the model emits:
- Default (per-page) mode — one entry per page. Each entry is the JSON
the model returned for that page: a single dict for single-record schemas, or a list of dicts for multi-record schemas (e.g., a page of table rows). Index as result[page_index] for the page's value, and result[page_index][record_index] when each page has multiple records.
- `fill_single_schema=True` — a single-element list whose element is
the JSON for the whole document (typically one dict).
If you need to support both single- and multi-record schemas in the same code path, normalize the per-page entries yourself (e.g., wrap a dict in [dict]).
LaTeX conversion
URLs and recursive crawling
Bounding boxes
Audio
Audio inputs require a Gemini model (the only provider with audio support).
Token cost tracking
Key kwargs reference
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/lexoid-python/SKILL.md
Popularity
- Repository stars
- 108
- Repository forks
- 14
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 30 Aug 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/oidlabs-com/lexoid/lexoid-python)