Run2 file analyzer
Robust extraction of text from various file formats (PDF, DOCX, etc).From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill run2_file-analyzerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
0.7 KB, 137 tokens by cl100k_base, as published. Nobody here has run it
File Analyzer Skill
This skill provides a unified interface to extract text from different file formats for further classification.
Dependencies
pypdf,python-docx
Usage
from pypdf import PdfReader
import docx
def get_text_from_file(file_path):
if file_path.endswith('.pdf'):
reader = PdfReader(file_path)
return " ".join([page.extract_text() for page in reader.pages if page.extract_text()])
elif file_path.endswith('.docx'):
doc = docx.Document(file_path)
return " ".join([p.text for p in doc.paragraphs])
return ""
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.