Document Organizer Skill
Classifies and organizes documents (PDF, DOCX, PPTX) into subject folders using keyword-based text extraction and scoring.
Categories
- LLM - Large Language Models papers
- trapped_ion_and_qc - Trapped ion and quantum computing
- black_hole - Black hole physics
- DNA - DNA-related research
- music_history - Music history and evolution
Usage
pythonimport sys sys.path.insert(0, '/app/environment/skills/evo-doc-organizer/scripts') from utils import organize_documents, validate_organization # Organize all documents from source into category folders source_dir = '/root/papers/all' output_dir = '/root/papers' assignments = organize_documents(source_dir, output_dir) # Validate the organization validate_organization(source_dir, output_dir)
Functions
extract_text(filepath)- Extract text from PDF/DOCX/PPTXextract_text_pdf(filepath, max_pages=3)- Extract from PDF using pdftotext + PyPDF2 fallbackextract_text_docx(filepath)- Extract from DOCX using python-docxextract_text_pptx(filepath)- Extract from PPTX using python-pptxclassify_document(text)- Classify text into one of 5 categories using weighted keywordsorganize_documents(source_dir, output_base_dir)- Full pipeline: extract, classify, copyvalidate_organization(source_dir, output_base_dir)- Verify all files organized correctly
Key Design Decisions
- Uses weighted keyword scoring for robust classification
- Falls back to music_history as the catch-all category
- Copies files (preserves originals) rather than moving
- Validates file count, uniqueness, and size preservation


