xberg
Qué hace
Esta habilidad ayuda a los desarrolladores a usar la biblioteca Xberg para leer documentos en Python, Node.js, Rust o la línea de comandos. Está pensada para personas que crean herramientas que necesitan el texto o los datos que contienen los documentos.
Cuándo usarla
- ✓Cuando escribes código que extrae texto de PDF, archivos de Word o correos electrónicos.
- ✓Cuando necesitas aplicar OCR a páginas escaneadas o imágenes.
- ✓Cuando quieres procesar muchos documentos en un solo lote con los mismos ajustes.
Link de la skill
https://github.com/xberg-io/xberg/blob/main/plugin/.ai-rulez/skills/xberg/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Escribe un script en Python que saque el texto y las tablas de todas mis facturas en PDF.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente instala el paquete de Xberg para tu lenguaje, elige las opciones que necesitas, como OCR o troceado, y escribe el código que devuelve el texto, las tablas y los metadatos de cada documento.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Xberg Document Extraction
Xberg is a document intelligence library with a Rust core and bindings for Python, TypeScript/Node.js, Ruby, PHP, Go, Java, C#, Elixir, WebAssembly, Dart, Kotlin Android, Swift, Zig, and C. It extracts text, tables, metadata, and images from 107 formats across 140 unique file extensions and accepts 53 compatibility MIME aliases, including PDF, Office documents, images, HTML, email, archives, and academic formats.
Use this skill when writing code that:
- Extracts text or metadata from documents
- Performs OCR on scanned documents or images
- Batch-processes multiple files
- Configures extraction options (output format, chunking, OCR, language detection)
- Implements custom plugins (post-processors, validators, OCR backends)
If the
xbergMCP server is registered in this session, prefer its tools over shelling out to the CLI — they expose the same extraction surface with structured arguments and results.
Installation
Python
pip install xberg
Node.js
npm install @xberg-io/xberg
Rust
cargo add xberg
# Cargo.toml
[dependencies]
xberg = { version = "1.1.0", features = ["full"] }
tokio = { version = "1", features = ["full"] }
# feature flags: pdf, ocr, chunking, embeddings, language-detection, keywords, api, mcp
# (or "formats" / "full" aggregates); tokio-runtime is on by default
CLI
brew install xberg-io/tap/xberg
# or run without a persistent install (the CLI proxy package self-installs the binary):
npx @xberg-io/xberg-cli@1.3.10 --help
uvx --from xberg-cli==1.3.8 xberg --help
# or download a prebuilt binary from the latest GitHub release:
# https://github.com/xberg-io/xberg/releases/latest
# or build from source:
cargo install xberg-cli
Quick Start
The library entry points are extract(input, config) and extract_batch(inputs, config). Both return an ExtractionResult envelope — the extracted document(s) live in result.results, and per-document data (content, tables, metadata, …) is on each result.results[i]. Python and Node are async-only.
Python
import asyncio
from xberg import ExtractInput, extract, ExtractionConfig
async def main() -> None:
result = await extract(ExtractInput(uri="document.pdf"), ExtractionConfig())
doc = result.results[0]
print(doc.content) # extracted text
print(doc.metadata) # document metadata
print(doc.tables) # extracted tables
asyncio.run(main())
Node.js
import { extract } from "@xberg-io/xberg";
const output = await extract({ kind: "uri", uri: "document.pdf" });
const doc = output.results[0];
console.log(doc.content);
console.log(doc.metadata);
console.log(doc.tables);
Rust
use xberg::{extract, ExtractInput, ExtractionConfig};
#[tokio::main]
async fn main() -> xberg::Result<()> {
let output = extract(ExtractInput::from_uri("document.pdf"), &ExtractionConfig::default()).await?;
println!("{}", output.results[0].content);
Ok(())
}
CLI
xberg extract document.pdf
xberg extract document.pdf --format json
xberg extract document.pdf --content-format markdown
Configuration
All languages use the same configuration structure with language-appropriate naming conventions.
Python (snake_case)
from xberg import (
ExtractInput, extract,
ExtractionConfig, OcrConfig, TesseractConfig, PdfConfig, ChunkingConfig, OutputFormat,
)
config = ExtractionConfig(
ocr=OcrConfig(
backend="tesseract",
language=["eng"],
tesseract_config=TesseractConfig(psm=6, enable_table_detection=True),
),
pdf_options=PdfConfig(passwords=["secret123"]),
chunking=ChunkingConfig(max_characters=1000, overlap=200),
output_format=OutputFormat("markdown"),
)
result = await extract(ExtractInput(uri="document.pdf"), config)
Node.js (camelCase)
import { extract, type ExtractionConfig } from "@xberg-io/xberg";
const config: ExtractionConfig = {
ocr: { backend: "tesseract", language: ["eng"] },
pdfOptions: { passwords: ["secret123"] },
chunking: { maxCharacters: 1000, overlap: 200 },
outputFormat: "markdown",
};
const output = await extract({ kind: "uri", uri: "document.pdf" }, config);
Rust (snake_case)
use xberg::{extract, ExtractInput, ExtractionConfig, OcrConfig, ChunkingConfig, OutputFormat};
let config = ExtractionConfig {
ocr: Some
Preguntas frecuentes
¿Qué lenguajes cubre?
La habilidad cubre Python, Node.js y TypeScript, Rust y la línea de comandos, y enumera también otros enlaces de lenguaje.
¿Puede leer documentos escaneados?
Sí. Puede aplicar OCR a páginas escaneadas e imágenes, y forzarlo cuando un PDF no tiene texto utilizable.
¿Necesita un servidor aparte?
No. La habilidad usa la biblioteca directamente, aunque prefiere las herramientas de Xberg cuando ese servidor está conectado.
Detalles
Descripción original del autor
Extract text, tables, metadata, and images from 107 document formats (PDF, Office, images, HTML, email, archives, academic) using Xberg. Use when writing code that calls Xberg APIs in Python, Node.js/TypeScript, Rust, or CLI. Covers installation, extraction (sync/async), configuration (OCR, chunking, output format), batch processing, error handling, and plugins.
repo: xberg-io/xberg
Popularidad
- Estrellas en GitHub
- 9,5 mil
- Posición en el ranking
- #12274
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
xberg-batch-extraction
9,5 milAyuda a tu agente a procesar muchos documentos a la vez con Xberg, compartiendo un único conjunto de opciones, limitando el trabajo en paralelo y evitando que los archivos con error detengan la ejecución.
xberg-chunking
9,5 milAyuda a tu agente a dividir textos largos de documentos en fragmentos más pequeños para prompts de IA o índices de búsqueda, con tamaños fijados y solapamiento opcional.
xberg-extracting-keywords
9,5 milAyuda a tu agente a extraer las palabras clave o frases clave principales de un documento y a detectar su idioma, usando los ajustes de palabras clave de Xberg.
xberg-extracting-tables
9,5 milAyuda a tu agente a extraer tablas de PDF, hojas de cálculo e imágenes, manteniendo intactas las filas y columnas como Markdown o datos estructurados.
Skills parecidas
api-connector-builder
280 milHace que tu agente cree nuevas conexiones de API siguiendo el patrón existente. Úsalo para añadir una integración más sin inventar otra forma de hacer las cosas.
api-design
280 milAyuda a tu agente a diseñar APIs REST según las buenas prácticas. Es útil para definir cómo se comunican las APIs, cómo se muestran los errores y cómo organizar los datos.
backend-patterns
280 milAyuda a tu agente con patrones de arquitectura del lado del servidor y optimización de bases de datos. Es útil para crear o revisar código que se ejecuta en el servidor.