🚀 Content Core
Content Core is a powerful, AI-powered content extraction and processing platform. It can transform any source into clean, structured content. You can extract text from websites, transcribe videos, process documents, and generate AI summaries through a unified interface with multiple integration options.
🚀 Quick Start
You can quickly integrate content-core into your Python projects to extract, clean, and summarize content from various sources.
import content_core as cc
result = await cc.extract("https://example.com/article")
cleaned_text = await cc.clean("...messy text with [brackets] and extra spaces...")
summary = await cc.summarize_content("long article text", context="explain to a child")
✨ Features
Extract content from anywhere
- 📄 Documents: PDF, Word, PowerPoint, Excel, Markdown, HTML, EPUB
- 🎥 Media: Videos (MP4, AVI, MOV) with automatic transcription
- 🎵 Audio: MP3, WAV, M4A with speech-to-text conversion
- 🌐 Web: Any URL with intelligent content extraction
- 🖼️ Images: JPG, PNG, TIFF with OCR text recognition
- 📦 Archives: ZIP, TAR, GZ with content analysis
Process with AI
- ✨ Clean & format extracted content automatically
- 📝 Generate summaries with customizable styles (bullet points, executive summary, etc.)
- 🎯 Context-aware processing: explain to a child, technical summary, action items
- 🔄 Smart engine selection: automatically chooses the best extraction method
Key Features
- 🎯 Intelligent Auto-Detection: Automatically selects the best extraction method based on content type and available services
- 🔧 Smart Engine Selection:
- URLs: Firecrawl → Jina → BeautifulSoup fallback chain
- Documents: Docling → Enhanced PyMuPDF → Simple extraction fallback
- Media: OpenAI Whisper transcription
- Images: OCR with multiple engine support
- 📊 Enhanced PDF Processing: Advanced PyMuPDF engine with quality flags, table detection, and optional OCR for mathematical formulas
- 🌍 Multiple Integrations: CLI, Python library, MCP server, Raycast extension, macOS Services
- ⚡ Zero-Install Options: Use
uvx for instant access without installation
- 🧠 AI-Powered Processing: LLM integration for content cleaning and summarization
- 🔄 Asynchronous: Built with
asyncio for efficient processing
📦 Installation
Install Content Core using pip:
pip install content-core
pip install content-core[docling]
pip install content-core
pip install content-core[docling]
Alternatively, if you’re developing locally:
git clone https://github.com/lfnovo/content-core
cd content-core
uv sync
💻 Usage Examples
🖥️ Command Line (Zero Install)
uvx --from "content-core" ccore https://example.com
uvx --from "content-core" ccore document.pdf
uvx --from "content-core" csum video.mp4 --context "bullet points"
🤖 Claude Desktop Integration
One-click setup with Model Context Protocol (MCP) - extract content directly in Claude conversations.
🔍 Raycast Extension
Smart auto-detection commands:
- Extract Content: Full interface with format options
- Summarize Content: 9 summary styles available
- Quick Extract: Instant clipboard extraction
🖱️ macOS Right-Click Integration
Right-click any file in Finder → Services → Extract or Summarize content instantly.
🐍 Python Library
import content_core as cc
result = await cc.extract("https://example.com/article")
summary = await cc.summarize_content(result, context="explain to a child")
📚 Documentation
For more information on how to use the Content Core library, including details on AI model configuration and customization, refer to our Usage Documentation.
🔧 Technical Details
MCP Server Integration
Content Core includes a Model Context Protocol (MCP) server that enables seamless integration with Claude Desktop and other MCP-compatible applications. The MCP server exposes Content Core's powerful extraction capabilities through a standardized protocol.
Quick Setup with Claude Desktop
pip install content-core
uvx --from "content-core" content-core-mcp
Add to your claude_desktop_config.json:
{
"mcpServers": {
"content-core": {
"command": "uvx",
"args": [
"--from",
"content-core",
"content-core-mcp"
]
}
}
}
For detailed setup instructions, configuration options, and usage examples, see our MCP Documentation.
Enhanced PDF Processing
Content Core features an optimized PyMuPDF extraction engine with significant improvements for scientific documents and complex PDFs.
Key Improvements
- 🔬 Mathematical Formula Extraction: Enhanced quality flags eliminate
<!-- formula-not-decoded --> placeholders
- 📊 Automatic Table Detection: Tables converted to markdown format for LLM consumption
- 🔧 Quality Text Rendering: Better ligature, whitespace, and image-text integration
- ⚡ Optional OCR Enhancement: Selective OCR for formula-heavy pages (requires Tesseract)
Configuration for Scientific Documents
For documents with heavy mathematical content, enable OCR enhancement:
extraction:
pymupdf:
enable_formula_ocr: true
formula_threshold: 3
ocr_fallback: true
from content_core.config import set_pymupdf_ocr_enabled
set_pymupdf_ocr_enabled(True)
Requirements for OCR Enhancement
brew install tesseract
sudo apt-get install tesseract-ocr
Note: OCR is optional - you get improved PDF extraction automatically without any additional setup.
macOS Services Integration
Content Core provides powerful right-click integration with macOS Finder, allowing you to extract and summarize content from any file without installation. Choose between clipboard or TextEdit output for maximum flexibility.
Available Services
Create 4 convenient services for different workflows:
- Extract Content → Clipboard: Quick copy for immediate pasting
- Extract Content → TextEdit: Review before using
- Summarize Content → Clipboard: Quick summary copying
- Summarize Content → TextEdit: Formatted summary with headers
Quick Setup
- Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh
- Create services manually using Automator (5 minutes setup)
Usage
Right-click any supported file in Finder → Services → Choose your option:
- PDFs, Word docs: Instant text extraction
- Videos, audio files: Automatic transcription
- Images: OCR text recognition
- Web content: Clean text extraction
- Multiple files: Batch processing support
Features
- Zero-install processing: Uses
uvx for isolated execution
- Multiple output options: Clipboard or TextEdit display
- System notifications: Visual feedback on completion
- Wide format support: 20+ file types supported
- Batch processing: Handle multiple files at once
- Keyboard shortcuts: Assignable hotkeys for power users
For complete setup instructions with copy-paste scripts, see macOS Services Documentation.
Raycast Extension
Content Core provides a powerful Raycast extension with smart auto-detection that handles both URLs and file paths seamlessly. Extract and summarize content directly from your Raycast interface without switching applications.
Quick Setup
From Raycast Store (coming soon):
- Open Raycast and search for "Content Core"
- Install the extension by
luis_novo
- Configure API keys in preferences
Manual Installation:
- Download the extension from the repository
- Open Raycast → "Import Extension"
- Select the
raycast-content-core folder
Commands
- 🔍 Extract Content: Smart URL/file detection with full interface
- Auto-detects URLs vs file paths in real-time
- Multiple output formats (Text, JSON, XML)
- Drag & drop support for files
- Rich results view with metadata
- 📝 Summarize Content: AI-powered summaries with customizable styles
- 9 different summary styles (bullet points, executive summary, etc.)
- Auto-detects source type with visual feedback
- One-click snippet creation and quicklinks
- ⚡ Quick Extract: Instant extraction to clipboard
- Type → Tab → Paste source → Enter
- No UI, works directly from command bar
- Perfect for quick workflows
Features
- Smart Auto-Detection: Instantly recognizes URLs vs file paths
- Zero Installation: Uses
uvx for Content Core execution
- Rich Integration: Keyboard shortcuts, clipboard actions, Raycast snippets
- All File Types: Documents, videos, audio, images, archives
- Visual Feedback: Real-time type detection with icons
For detailed setup, configuration, and usage examples, see Raycast Extension Documentation.
Using with Langchain
For users integrating with the Langchain framework, content-core exposes a set of compatible tools. These tools, located in the src/content_core/tools directory, allow you to leverage content-core extraction, cleaning, and summarization capabilities directly within your Langchain agents and chains.
You can import and use these tools like any other Langchain tool. For example:
from content_core.tools import extract_content_tool, cleanup_content_tool, summarize_content_tool
from langchain.agents import initialize_agent, AgentType
tools = [extract_content_tool, cleanup_content_tool, summarize_content_tool]
agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
agent.run("Extract the content from https://example.com and then summarize it.")
Refer to the source code in src/content_core/tools for specific tool implementations and usage details.
Basic Usage
The core functionality revolves around the extract_content function.
import asyncio
from content_core.extraction import extract_content
async def main():
text_data = await extract_content({"content": "This is my sample text content."})
print(text_data)
url_data = await extract_content({"url": "https://www.example.com"})
print(url_data)
video_data = await extract_content({"file_path": "path/to/your/video.mp4"})
print(video_data)
md_data = await extract_content({"file_path": "path/to/your/document.md"})
print(md_data)
doc_data = await extract_content({
"file_path": "path/to/your/document.pdf",
"document_engine": "docling",
"output_format": "html"
})
url_data = await extract_content({
"url": "https://www.example.com",
"url_engine": "firecrawl"
})
print(doc_data)
if __name__ == "__main__":
asyncio.run(main())
(See src/content_core/notebooks/run.ipynb for more detailed examples.)
Docling Integration
Content Core supports an optional Docling-based extraction engine for rich document formats (PDF, DOCX, PPTX, XLSX, Markdown, AsciiDoc, HTML, CSV, Images).
Enabling Docling
Docling is not the default engine when parsing documents. If you don't want to use it, you need to set engine to "simple".
Via configuration file
In your cc_config.yaml or custom config, set:
extraction:
document_engine: docling
url_engine: auto
docling:
output_format: markdown
Programmatically in Python
from content_core.config import set_document_engine, set_url_engine, set_docling_output_format
set_document_engine("docling")
set_url_engine("firecrawl")
set_docling_output_format("html")
result = await cc.extract("document.pdf")
Configuration
Configuration settings (like API keys for external services, logging levels) can be managed through environment variables or .env files, loaded automatically via python-dotenv.
Example .env:
OPENAI_API_KEY=your-key-here
GOOGLE_API_KEY=your-key-here
# Engine Selection (optional)
CCORE_DOCUMENT_ENGINE=auto # auto, simple, docling
CCORE_URL_ENGINE=auto # auto, simple, firecrawl, jina
Engine Selection via Environment Variables
For deployment scenarios like MCP servers or Raycast extensions, you can override the extraction engines using environment variables:
CCORE_DOCUMENT_ENGINE: Force document engine (auto, simple, docling)
CCORE_URL_ENGINE: Force URL engine (auto, simple, firecrawl, jina)
These variables take precedence over config file settings and provide explicit control for different deployment scenarios.
Custom Prompt Templates
Content Core allows you to define custom prompt templates for content processing. By default, the library uses built-in prompts located in the prompts directory. However, you can create your own prompt templates and store them in a dedicated directory. To specify the location of your custom prompts, set the PROMPT_PATH environment variable in your .env file or system environment.
Example .env with custom prompt path:
OPENAI_API_KEY=your-key-here
GOOGLE_API_KEY=your-key-here
PROMPT_PATH=/path/to/your/custom/prompts
When a prompt template is requested, Content Core will first look in the custom directory specified by PROMPT_PATH (if set and exists). If the template is not found there, it will fall back to the default built-in prompts. This allows you to override specific prompts while still using the default ones for others.
Development
To set up a development environment:
git clone <repository-url>
cd content-core
uv venv
source .venv/bin/activate
uv sync --group dev
make test
make lint
make help
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please see our Contributing Guide for more details on how to get started.