scientific-writer 2.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scientific_writer/.claude/WRITER.md +822 -0
- scientific_writer/.claude/settings.local.json +30 -0
- scientific_writer/.claude/skills/citation-management/SKILL.md +1046 -0
- scientific_writer/.claude/skills/citation-management/assets/bibtex_template.bib +264 -0
- scientific_writer/.claude/skills/citation-management/assets/citation_checklist.md +386 -0
- scientific_writer/.claude/skills/citation-management/references/bibtex_formatting.md +908 -0
- scientific_writer/.claude/skills/citation-management/references/citation_validation.md +794 -0
- scientific_writer/.claude/skills/citation-management/references/google_scholar_search.md +725 -0
- scientific_writer/.claude/skills/citation-management/references/metadata_extraction.md +870 -0
- scientific_writer/.claude/skills/citation-management/references/pubmed_search.md +839 -0
- scientific_writer/.claude/skills/citation-management/scripts/doi_to_bibtex.py +204 -0
- scientific_writer/.claude/skills/citation-management/scripts/extract_metadata.py +569 -0
- scientific_writer/.claude/skills/citation-management/scripts/format_bibtex.py +349 -0
- scientific_writer/.claude/skills/citation-management/scripts/search_google_scholar.py +282 -0
- scientific_writer/.claude/skills/citation-management/scripts/search_pubmed.py +398 -0
- scientific_writer/.claude/skills/citation-management/scripts/validate_citations.py +497 -0
- scientific_writer/.claude/skills/clinical-reports/IMPLEMENTATION_SUMMARY.md +641 -0
- scientific_writer/.claude/skills/clinical-reports/README.md +236 -0
- scientific_writer/.claude/skills/clinical-reports/SKILL.md +1088 -0
- scientific_writer/.claude/skills/clinical-reports/assets/case_report_template.md +352 -0
- scientific_writer/.claude/skills/clinical-reports/assets/clinical_trial_csr_template.md +353 -0
- scientific_writer/.claude/skills/clinical-reports/assets/clinical_trial_sae_template.md +359 -0
- scientific_writer/.claude/skills/clinical-reports/assets/consult_note_template.md +305 -0
- scientific_writer/.claude/skills/clinical-reports/assets/discharge_summary_template.md +453 -0
- scientific_writer/.claude/skills/clinical-reports/assets/hipaa_compliance_checklist.md +395 -0
- scientific_writer/.claude/skills/clinical-reports/assets/history_physical_template.md +305 -0
- scientific_writer/.claude/skills/clinical-reports/assets/lab_report_template.md +309 -0
- scientific_writer/.claude/skills/clinical-reports/assets/pathology_report_template.md +249 -0
- scientific_writer/.claude/skills/clinical-reports/assets/quality_checklist.md +338 -0
- scientific_writer/.claude/skills/clinical-reports/assets/radiology_report_template.md +318 -0
- scientific_writer/.claude/skills/clinical-reports/assets/soap_note_template.md +253 -0
- scientific_writer/.claude/skills/clinical-reports/references/case_report_guidelines.md +570 -0
- scientific_writer/.claude/skills/clinical-reports/references/clinical_trial_reporting.md +693 -0
- scientific_writer/.claude/skills/clinical-reports/references/data_presentation.md +530 -0
- scientific_writer/.claude/skills/clinical-reports/references/diagnostic_reports_standards.md +629 -0
- scientific_writer/.claude/skills/clinical-reports/references/medical_terminology.md +588 -0
- scientific_writer/.claude/skills/clinical-reports/references/patient_documentation.md +744 -0
- scientific_writer/.claude/skills/clinical-reports/references/peer_review_standards.md +585 -0
- scientific_writer/.claude/skills/clinical-reports/references/regulatory_compliance.md +577 -0
- scientific_writer/.claude/skills/clinical-reports/scripts/check_deidentification.py +346 -0
- scientific_writer/.claude/skills/clinical-reports/scripts/compliance_checker.py +78 -0
- scientific_writer/.claude/skills/clinical-reports/scripts/extract_clinical_data.py +102 -0
- scientific_writer/.claude/skills/clinical-reports/scripts/format_adverse_events.py +103 -0
- scientific_writer/.claude/skills/clinical-reports/scripts/generate_report_template.py +163 -0
- scientific_writer/.claude/skills/clinical-reports/scripts/terminology_validator.py +133 -0
- scientific_writer/.claude/skills/clinical-reports/scripts/validate_case_report.py +334 -0
- scientific_writer/.claude/skills/clinical-reports/scripts/validate_trial_report.py +89 -0
- scientific_writer/.claude/skills/document-skills/docx/LICENSE.txt +30 -0
- scientific_writer/.claude/skills/document-skills/docx/SKILL.md +197 -0
- scientific_writer/.claude/skills/document-skills/docx/docx-js.md +350 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/pack.py +159 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/unpack.py +29 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/validate.py +69 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/validation/__init__.py +15 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/validation/base.py +951 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/validation/docx.py +274 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/validation/pptx.py +315 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml/scripts/validation/redlining.py +279 -0
- scientific_writer/.claude/skills/document-skills/docx/ooxml.md +610 -0
- scientific_writer/.claude/skills/document-skills/docx/scripts/__init__.py +1 -0
- scientific_writer/.claude/skills/document-skills/docx/scripts/document.py +1276 -0
- scientific_writer/.claude/skills/document-skills/docx/scripts/templates/comments.xml +3 -0
- scientific_writer/.claude/skills/document-skills/docx/scripts/templates/commentsExtended.xml +3 -0
- scientific_writer/.claude/skills/document-skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- scientific_writer/.claude/skills/document-skills/docx/scripts/templates/commentsIds.xml +3 -0
- scientific_writer/.claude/skills/document-skills/docx/scripts/templates/people.xml +3 -0
- scientific_writer/.claude/skills/document-skills/docx/scripts/utilities.py +374 -0
- scientific_writer/.claude/skills/document-skills/pdf/LICENSE.txt +30 -0
- scientific_writer/.claude/skills/document-skills/pdf/SKILL.md +294 -0
- scientific_writer/.claude/skills/document-skills/pdf/forms.md +205 -0
- scientific_writer/.claude/skills/document-skills/pdf/reference.md +612 -0
- scientific_writer/.claude/skills/document-skills/pdf/scripts/check_bounding_boxes.py +70 -0
- scientific_writer/.claude/skills/document-skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
- scientific_writer/.claude/skills/document-skills/pdf/scripts/check_fillable_fields.py +12 -0
- scientific_writer/.claude/skills/document-skills/pdf/scripts/convert_pdf_to_images.py +35 -0
- scientific_writer/.claude/skills/document-skills/pdf/scripts/create_validation_image.py +41 -0
- scientific_writer/.claude/skills/document-skills/pdf/scripts/extract_form_field_info.py +152 -0
- scientific_writer/.claude/skills/document-skills/pdf/scripts/fill_fillable_fields.py +114 -0
- scientific_writer/.claude/skills/document-skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- scientific_writer/.claude/skills/document-skills/pptx/LICENSE.txt +30 -0
- scientific_writer/.claude/skills/document-skills/pptx/SKILL.md +484 -0
- scientific_writer/.claude/skills/document-skills/pptx/html2pptx.md +625 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/pack.py +159 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/unpack.py +29 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/validate.py +69 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/validation/base.py +951 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/validation/docx.py +274 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
- scientific_writer/.claude/skills/document-skills/pptx/ooxml.md +427 -0
- scientific_writer/.claude/skills/document-skills/pptx/scripts/html2pptx.js +979 -0
- scientific_writer/.claude/skills/document-skills/pptx/scripts/inventory.py +1020 -0
- scientific_writer/.claude/skills/document-skills/pptx/scripts/rearrange.py +231 -0
- scientific_writer/.claude/skills/document-skills/pptx/scripts/replace.py +385 -0
- scientific_writer/.claude/skills/document-skills/pptx/scripts/thumbnail.py +450 -0
- scientific_writer/.claude/skills/document-skills/xlsx/LICENSE.txt +30 -0
- scientific_writer/.claude/skills/document-skills/xlsx/SKILL.md +289 -0
- scientific_writer/.claude/skills/document-skills/xlsx/recalc.py +178 -0
- scientific_writer/.claude/skills/hypothesis-generation/SKILL.md +155 -0
- scientific_writer/.claude/skills/hypothesis-generation/assets/hypothesis_output_template.md +302 -0
- scientific_writer/.claude/skills/hypothesis-generation/references/experimental_design_patterns.md +327 -0
- scientific_writer/.claude/skills/hypothesis-generation/references/hypothesis_quality_criteria.md +196 -0
- scientific_writer/.claude/skills/hypothesis-generation/references/literature_search_strategies.md +505 -0
- scientific_writer/.claude/skills/latex-posters/README.md +417 -0
- scientific_writer/.claude/skills/latex-posters/SKILL.md +919 -0
- scientific_writer/.claude/skills/latex-posters/assets/baposter_template.tex +257 -0
- scientific_writer/.claude/skills/latex-posters/assets/beamerposter_template.tex +244 -0
- scientific_writer/.claude/skills/latex-posters/assets/poster_quality_checklist.md +358 -0
- scientific_writer/.claude/skills/latex-posters/assets/tikzposter_template.tex +251 -0
- scientific_writer/.claude/skills/latex-posters/references/latex_poster_packages.md +745 -0
- scientific_writer/.claude/skills/latex-posters/references/poster_content_guide.md +748 -0
- scientific_writer/.claude/skills/latex-posters/references/poster_design_principles.md +806 -0
- scientific_writer/.claude/skills/latex-posters/references/poster_layout_design.md +900 -0
- scientific_writer/.claude/skills/latex-posters/scripts/review_poster.sh +214 -0
- scientific_writer/.claude/skills/literature-review/SKILL.md +546 -0
- scientific_writer/.claude/skills/literature-review/assets/review_template.md +412 -0
- scientific_writer/.claude/skills/literature-review/references/citation_styles.md +166 -0
- scientific_writer/.claude/skills/literature-review/references/database_strategies.md +381 -0
- scientific_writer/.claude/skills/literature-review/scripts/generate_pdf.py +176 -0
- scientific_writer/.claude/skills/literature-review/scripts/search_databases.py +303 -0
- scientific_writer/.claude/skills/literature-review/scripts/verify_citations.py +222 -0
- scientific_writer/.claude/skills/markitdown/INSTALLATION_GUIDE.md +318 -0
- scientific_writer/.claude/skills/markitdown/LICENSE.txt +22 -0
- scientific_writer/.claude/skills/markitdown/OPENROUTER_INTEGRATION.md +359 -0
- scientific_writer/.claude/skills/markitdown/QUICK_REFERENCE.md +309 -0
- scientific_writer/.claude/skills/markitdown/README.md +184 -0
- scientific_writer/.claude/skills/markitdown/SKILL.md +450 -0
- scientific_writer/.claude/skills/markitdown/SKILL_SUMMARY.md +307 -0
- scientific_writer/.claude/skills/markitdown/assets/example_usage.md +463 -0
- scientific_writer/.claude/skills/markitdown/references/api_reference.md +399 -0
- scientific_writer/.claude/skills/markitdown/references/file_formats.md +542 -0
- scientific_writer/.claude/skills/markitdown/scripts/batch_convert.py +228 -0
- scientific_writer/.claude/skills/markitdown/scripts/convert_literature.py +283 -0
- scientific_writer/.claude/skills/markitdown/scripts/convert_with_ai.py +243 -0
- scientific_writer/.claude/skills/paper-2-web/SKILL.md +455 -0
- scientific_writer/.claude/skills/paper-2-web/references/installation.md +141 -0
- scientific_writer/.claude/skills/paper-2-web/references/paper2poster.md +346 -0
- scientific_writer/.claude/skills/paper-2-web/references/paper2video.md +305 -0
- scientific_writer/.claude/skills/paper-2-web/references/paper2web.md +187 -0
- scientific_writer/.claude/skills/paper-2-web/references/usage_examples.md +436 -0
- scientific_writer/.claude/skills/peer-review/SKILL.md +375 -0
- scientific_writer/.claude/skills/peer-review/references/common_issues.md +552 -0
- scientific_writer/.claude/skills/peer-review/references/reporting_standards.md +290 -0
- scientific_writer/.claude/skills/research-grants/README.md +285 -0
- scientific_writer/.claude/skills/research-grants/SKILL.md +896 -0
- scientific_writer/.claude/skills/research-grants/assets/budget_justification_template.md +453 -0
- scientific_writer/.claude/skills/research-grants/assets/nih_specific_aims_template.md +166 -0
- scientific_writer/.claude/skills/research-grants/assets/nsf_project_summary_template.md +92 -0
- scientific_writer/.claude/skills/research-grants/references/broader_impacts.md +392 -0
- scientific_writer/.claude/skills/research-grants/references/darpa_guidelines.md +636 -0
- scientific_writer/.claude/skills/research-grants/references/doe_guidelines.md +586 -0
- scientific_writer/.claude/skills/research-grants/references/nih_guidelines.md +851 -0
- scientific_writer/.claude/skills/research-grants/references/nsf_guidelines.md +570 -0
- scientific_writer/.claude/skills/research-grants/references/specific_aims_guide.md +458 -0
- scientific_writer/.claude/skills/research-lookup/README.md +116 -0
- scientific_writer/.claude/skills/research-lookup/SKILL.md +443 -0
- scientific_writer/.claude/skills/research-lookup/examples.py +174 -0
- scientific_writer/.claude/skills/research-lookup/lookup.py +93 -0
- scientific_writer/.claude/skills/research-lookup/research_lookup.py +335 -0
- scientific_writer/.claude/skills/research-lookup/scripts/research_lookup.py +261 -0
- scientific_writer/.claude/skills/scholar-evaluation/SKILL.md +254 -0
- scientific_writer/.claude/skills/scholar-evaluation/references/evaluation_framework.md +663 -0
- scientific_writer/.claude/skills/scholar-evaluation/scripts/calculate_scores.py +378 -0
- scientific_writer/.claude/skills/scientific-critical-thinking/SKILL.md +530 -0
- scientific_writer/.claude/skills/scientific-critical-thinking/references/common_biases.md +364 -0
- scientific_writer/.claude/skills/scientific-critical-thinking/references/evidence_hierarchy.md +484 -0
- scientific_writer/.claude/skills/scientific-critical-thinking/references/experimental_design.md +496 -0
- scientific_writer/.claude/skills/scientific-critical-thinking/references/logical_fallacies.md +478 -0
- scientific_writer/.claude/skills/scientific-critical-thinking/references/scientific_method.md +169 -0
- scientific_writer/.claude/skills/scientific-critical-thinking/references/statistical_pitfalls.md +506 -0
- scientific_writer/.claude/skills/scientific-schematics/SKILL.md +2035 -0
- scientific_writer/.claude/skills/scientific-schematics/assets/block_diagram_template.tex +199 -0
- scientific_writer/.claude/skills/scientific-schematics/assets/circuit_template.tex +159 -0
- scientific_writer/.claude/skills/scientific-schematics/assets/flowchart_template.tex +161 -0
- scientific_writer/.claude/skills/scientific-schematics/assets/pathway_template.tex +162 -0
- scientific_writer/.claude/skills/scientific-schematics/assets/tikz_styles.tex +422 -0
- scientific_writer/.claude/skills/scientific-schematics/references/best_practices.md +562 -0
- scientific_writer/.claude/skills/scientific-schematics/references/diagram_types.md +637 -0
- scientific_writer/.claude/skills/scientific-schematics/references/python_libraries.md +791 -0
- scientific_writer/.claude/skills/scientific-schematics/references/tikz_guide.md +734 -0
- scientific_writer/.claude/skills/scientific-schematics/scripts/circuit_generator.py +307 -0
- scientific_writer/.claude/skills/scientific-schematics/scripts/compile_tikz.py +292 -0
- scientific_writer/.claude/skills/scientific-schematics/scripts/generate_flowchart.py +281 -0
- scientific_writer/.claude/skills/scientific-schematics/scripts/pathway_diagram.py +406 -0
- scientific_writer/.claude/skills/scientific-writing/SKILL.md +443 -0
- scientific_writer/.claude/skills/scientific-writing/references/citation_styles.md +720 -0
- scientific_writer/.claude/skills/scientific-writing/references/figures_tables.md +806 -0
- scientific_writer/.claude/skills/scientific-writing/references/imrad_structure.md +658 -0
- scientific_writer/.claude/skills/scientific-writing/references/reporting_guidelines.md +748 -0
- scientific_writer/.claude/skills/scientific-writing/references/writing_principles.md +824 -0
- scientific_writer/.claude/skills/treatment-plans/README.md +488 -0
- scientific_writer/.claude/skills/treatment-plans/SKILL.md +1536 -0
- scientific_writer/.claude/skills/treatment-plans/assets/STYLING_QUICK_REFERENCE.md +185 -0
- scientific_writer/.claude/skills/treatment-plans/assets/chronic_disease_management_plan.tex +665 -0
- scientific_writer/.claude/skills/treatment-plans/assets/general_medical_treatment_plan.tex +547 -0
- scientific_writer/.claude/skills/treatment-plans/assets/medical_treatment_plan.sty +222 -0
- scientific_writer/.claude/skills/treatment-plans/assets/mental_health_treatment_plan.tex +774 -0
- scientific_writer/.claude/skills/treatment-plans/assets/one_page_treatment_plan.tex +193 -0
- scientific_writer/.claude/skills/treatment-plans/assets/pain_management_plan.tex +799 -0
- scientific_writer/.claude/skills/treatment-plans/assets/perioperative_care_plan.tex +753 -0
- scientific_writer/.claude/skills/treatment-plans/assets/quality_checklist.md +471 -0
- scientific_writer/.claude/skills/treatment-plans/assets/rehabilitation_treatment_plan.tex +756 -0
- scientific_writer/.claude/skills/treatment-plans/references/goal_setting_frameworks.md +411 -0
- scientific_writer/.claude/skills/treatment-plans/references/intervention_guidelines.md +507 -0
- scientific_writer/.claude/skills/treatment-plans/references/regulatory_compliance.md +476 -0
- scientific_writer/.claude/skills/treatment-plans/references/specialty_specific_guidelines.md +655 -0
- scientific_writer/.claude/skills/treatment-plans/references/treatment_plan_standards.md +485 -0
- scientific_writer/.claude/skills/treatment-plans/scripts/check_completeness.py +318 -0
- scientific_writer/.claude/skills/treatment-plans/scripts/generate_template.py +244 -0
- scientific_writer/.claude/skills/treatment-plans/scripts/timeline_generator.py +369 -0
- scientific_writer/.claude/skills/treatment-plans/scripts/validate_treatment_plan.py +367 -0
- scientific_writer/.claude/skills/venue-templates/SKILL.md +590 -0
- scientific_writer/.claude/skills/venue-templates/assets/grants/nih_specific_aims.tex +235 -0
- scientific_writer/.claude/skills/venue-templates/assets/grants/nsf_proposal_template.tex +375 -0
- scientific_writer/.claude/skills/venue-templates/assets/journals/nature_article.tex +171 -0
- scientific_writer/.claude/skills/venue-templates/assets/journals/neurips_article.tex +283 -0
- scientific_writer/.claude/skills/venue-templates/assets/journals/plos_one.tex +317 -0
- scientific_writer/.claude/skills/venue-templates/assets/posters/beamerposter_academic.tex +311 -0
- scientific_writer/.claude/skills/venue-templates/references/conferences_formatting.md +564 -0
- scientific_writer/.claude/skills/venue-templates/references/grants_requirements.md +787 -0
- scientific_writer/.claude/skills/venue-templates/references/journals_formatting.md +486 -0
- scientific_writer/.claude/skills/venue-templates/references/posters_guidelines.md +628 -0
- scientific_writer/.claude/skills/venue-templates/scripts/customize_template.py +206 -0
- scientific_writer/.claude/skills/venue-templates/scripts/query_template.py +260 -0
- scientific_writer/.claude/skills/venue-templates/scripts/validate_format.py +255 -0
- scientific_writer/__init__.py +43 -0
- scientific_writer/api.py +393 -0
- scientific_writer/cli.py +326 -0
- scientific_writer/core.py +275 -0
- scientific_writer/models.py +76 -0
- scientific_writer/utils.py +289 -0
- scientific_writer-2.3.1.dist-info/METADATA +272 -0
- scientific_writer-2.3.1.dist-info/RECORD +315 -0
- scientific_writer-2.3.1.dist-info/WHEEL +4 -0
- scientific_writer-2.3.1.dist-info/entry_points.txt +2 -0
- scientific_writer-2.3.1.dist-info/licenses/LICENSE +22 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
# MarkItDown Installation Guide
|
|
2
|
+
|
|
3
|
+
## Prerequisites
|
|
4
|
+
|
|
5
|
+
- Python 3.10 or higher
|
|
6
|
+
- pip package manager
|
|
7
|
+
- Virtual environment (recommended)
|
|
8
|
+
|
|
9
|
+
## Basic Installation
|
|
10
|
+
|
|
11
|
+
### Install All Features (Recommended)
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install 'markitdown[all]'
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This installs support for all file formats and features.
|
|
18
|
+
|
|
19
|
+
### Install Specific Features
|
|
20
|
+
|
|
21
|
+
If you only need certain file formats, you can install specific dependencies:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# PDF support only
|
|
25
|
+
pip install 'markitdown[pdf]'
|
|
26
|
+
|
|
27
|
+
# Office documents
|
|
28
|
+
pip install 'markitdown[docx,pptx,xlsx]'
|
|
29
|
+
|
|
30
|
+
# Multiple formats
|
|
31
|
+
pip install 'markitdown[pdf,docx,pptx,xlsx,audio-transcription]'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Install from Source
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git clone https://github.com/microsoft/markitdown.git
|
|
38
|
+
cd markitdown
|
|
39
|
+
pip install -e 'packages/markitdown[all]'
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Optional Dependencies
|
|
43
|
+
|
|
44
|
+
| Feature | Installation | Use Case |
|
|
45
|
+
|---------|--------------|----------|
|
|
46
|
+
| All formats | `pip install 'markitdown[all]'` | Everything |
|
|
47
|
+
| PDF | `pip install 'markitdown[pdf]'` | PDF documents |
|
|
48
|
+
| Word | `pip install 'markitdown[docx]'` | DOCX files |
|
|
49
|
+
| PowerPoint | `pip install 'markitdown[pptx]'` | PPTX files |
|
|
50
|
+
| Excel (new) | `pip install 'markitdown[xlsx]'` | XLSX files |
|
|
51
|
+
| Excel (old) | `pip install 'markitdown[xls]'` | XLS files |
|
|
52
|
+
| Outlook | `pip install 'markitdown[outlook]'` | MSG files |
|
|
53
|
+
| Azure DI | `pip install 'markitdown[az-doc-intel]'` | Enhanced PDF |
|
|
54
|
+
| Audio | `pip install 'markitdown[audio-transcription]'` | WAV/MP3 |
|
|
55
|
+
| YouTube | `pip install 'markitdown[youtube-transcription]'` | YouTube videos |
|
|
56
|
+
|
|
57
|
+
## System Dependencies
|
|
58
|
+
|
|
59
|
+
### OCR Support (for scanned documents and images)
|
|
60
|
+
|
|
61
|
+
#### macOS
|
|
62
|
+
```bash
|
|
63
|
+
brew install tesseract
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Ubuntu/Debian
|
|
67
|
+
```bash
|
|
68
|
+
sudo apt-get update
|
|
69
|
+
sudo apt-get install tesseract-ocr
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### Windows
|
|
73
|
+
Download from: https://github.com/UB-Mannheim/tesseract/wiki
|
|
74
|
+
|
|
75
|
+
### Poppler Utils (for advanced PDF operations)
|
|
76
|
+
|
|
77
|
+
#### macOS
|
|
78
|
+
```bash
|
|
79
|
+
brew install poppler
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### Ubuntu/Debian
|
|
83
|
+
```bash
|
|
84
|
+
sudo apt-get install poppler-utils
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Verification
|
|
88
|
+
|
|
89
|
+
Test your installation:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Check version
|
|
93
|
+
python -c "import markitdown; print('MarkItDown installed successfully')"
|
|
94
|
+
|
|
95
|
+
# Test basic conversion
|
|
96
|
+
echo "Test" > test.txt
|
|
97
|
+
markitdown test.txt
|
|
98
|
+
rm test.txt
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Virtual Environment Setup
|
|
102
|
+
|
|
103
|
+
### Using venv
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Create virtual environment
|
|
107
|
+
python -m venv markitdown-env
|
|
108
|
+
|
|
109
|
+
# Activate (macOS/Linux)
|
|
110
|
+
source markitdown-env/bin/activate
|
|
111
|
+
|
|
112
|
+
# Activate (Windows)
|
|
113
|
+
markitdown-env\Scripts\activate
|
|
114
|
+
|
|
115
|
+
# Install
|
|
116
|
+
pip install 'markitdown[all]'
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Using conda
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Create environment
|
|
123
|
+
conda create -n markitdown python=3.12
|
|
124
|
+
|
|
125
|
+
# Activate
|
|
126
|
+
conda activate markitdown
|
|
127
|
+
|
|
128
|
+
# Install
|
|
129
|
+
pip install 'markitdown[all]'
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Using uv
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Create virtual environment
|
|
136
|
+
uv venv --python=3.12 .venv
|
|
137
|
+
|
|
138
|
+
# Activate
|
|
139
|
+
source .venv/bin/activate
|
|
140
|
+
|
|
141
|
+
# Install
|
|
142
|
+
uv pip install 'markitdown[all]'
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## AI Enhancement Setup (Optional)
|
|
146
|
+
|
|
147
|
+
For AI-powered image descriptions using OpenRouter:
|
|
148
|
+
|
|
149
|
+
### OpenRouter API
|
|
150
|
+
|
|
151
|
+
OpenRouter provides unified access to multiple AI models (GPT-4, Claude, Gemini, etc.) through a single API.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Install OpenAI SDK (required, already included with markitdown)
|
|
155
|
+
pip install openai
|
|
156
|
+
|
|
157
|
+
# Get API key from https://openrouter.ai/keys
|
|
158
|
+
|
|
159
|
+
# Set API key
|
|
160
|
+
export OPENROUTER_API_KEY="sk-or-v1-..."
|
|
161
|
+
|
|
162
|
+
# Add to shell profile for persistence
|
|
163
|
+
echo 'export OPENROUTER_API_KEY="sk-or-v1-..."' >> ~/.bashrc # Linux
|
|
164
|
+
echo 'export OPENROUTER_API_KEY="sk-or-v1-..."' >> ~/.zshrc # macOS
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Why OpenRouter?**
|
|
168
|
+
- Access to 100+ AI models through one API
|
|
169
|
+
- Choose between GPT-4, Claude, Gemini, and more
|
|
170
|
+
- Competitive pricing
|
|
171
|
+
- No vendor lock-in
|
|
172
|
+
- Simple OpenAI-compatible interface
|
|
173
|
+
|
|
174
|
+
**Popular Models for Image Description:**
|
|
175
|
+
- `anthropic/claude-sonnet-4.5` - **Recommended** - Best for scientific vision
|
|
176
|
+
- `anthropic/claude-3.5-sonnet` - Excellent technical analysis
|
|
177
|
+
- `openai/gpt-4o` - Good vision understanding
|
|
178
|
+
- `google/gemini-pro-vision` - Cost-effective option
|
|
179
|
+
|
|
180
|
+
See https://openrouter.ai/models for complete model list and pricing.
|
|
181
|
+
|
|
182
|
+
## Azure Document Intelligence Setup (Optional)
|
|
183
|
+
|
|
184
|
+
For enhanced PDF conversion:
|
|
185
|
+
|
|
186
|
+
1. Create Azure Document Intelligence resource in Azure Portal
|
|
187
|
+
2. Get endpoint and key
|
|
188
|
+
3. Set environment variables:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
export AZURE_DOCUMENT_INTELLIGENCE_KEY="your-key"
|
|
192
|
+
export AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT="https://your-endpoint.cognitiveservices.azure.com/"
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Docker Installation (Alternative)
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Clone repository
|
|
199
|
+
git clone https://github.com/microsoft/markitdown.git
|
|
200
|
+
cd markitdown
|
|
201
|
+
|
|
202
|
+
# Build image
|
|
203
|
+
docker build -t markitdown:latest .
|
|
204
|
+
|
|
205
|
+
# Run
|
|
206
|
+
docker run --rm -i markitdown:latest < input.pdf > output.md
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Troubleshooting
|
|
210
|
+
|
|
211
|
+
### Import Error
|
|
212
|
+
```
|
|
213
|
+
ModuleNotFoundError: No module named 'markitdown'
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**Solution**: Ensure you're in the correct virtual environment and markitdown is installed:
|
|
217
|
+
```bash
|
|
218
|
+
pip install 'markitdown[all]'
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Missing Feature
|
|
222
|
+
```
|
|
223
|
+
Error: PDF conversion not supported
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Solution**: Install the specific feature:
|
|
227
|
+
```bash
|
|
228
|
+
pip install 'markitdown[pdf]'
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### OCR Not Working
|
|
232
|
+
|
|
233
|
+
**Solution**: Install Tesseract OCR (see System Dependencies above)
|
|
234
|
+
|
|
235
|
+
### Permission Errors
|
|
236
|
+
|
|
237
|
+
**Solution**: Use virtual environment or install with `--user` flag:
|
|
238
|
+
```bash
|
|
239
|
+
pip install --user 'markitdown[all]'
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Upgrading
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
# Upgrade to latest version
|
|
246
|
+
pip install --upgrade 'markitdown[all]'
|
|
247
|
+
|
|
248
|
+
# Check version
|
|
249
|
+
pip show markitdown
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Uninstallation
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
pip uninstall markitdown
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Next Steps
|
|
259
|
+
|
|
260
|
+
After installation:
|
|
261
|
+
1. Read `QUICK_REFERENCE.md` for basic usage
|
|
262
|
+
2. See `SKILL.md` for comprehensive guide
|
|
263
|
+
3. Try example scripts in `scripts/` directory
|
|
264
|
+
4. Check `assets/example_usage.md` for practical examples
|
|
265
|
+
|
|
266
|
+
## Skill Scripts Setup
|
|
267
|
+
|
|
268
|
+
To use the skill scripts:
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
# Navigate to scripts directory
|
|
272
|
+
cd /Users/vinayak/Documents/claude-scientific-writer/.claude/skills/markitdown/scripts
|
|
273
|
+
|
|
274
|
+
# Scripts are already executable, just run them
|
|
275
|
+
python batch_convert.py --help
|
|
276
|
+
python convert_with_ai.py --help
|
|
277
|
+
python convert_literature.py --help
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Testing Installation
|
|
281
|
+
|
|
282
|
+
Create a test file to verify everything works:
|
|
283
|
+
|
|
284
|
+
```python
|
|
285
|
+
# test_markitdown.py
|
|
286
|
+
from markitdown import MarkItDown
|
|
287
|
+
|
|
288
|
+
def test_basic():
|
|
289
|
+
md = MarkItDown()
|
|
290
|
+
# Create a simple test file
|
|
291
|
+
with open("test.txt", "w") as f:
|
|
292
|
+
f.write("Hello MarkItDown!")
|
|
293
|
+
|
|
294
|
+
# Convert it
|
|
295
|
+
result = md.convert("test.txt")
|
|
296
|
+
print("✓ Basic conversion works")
|
|
297
|
+
print(result.text_content)
|
|
298
|
+
|
|
299
|
+
# Cleanup
|
|
300
|
+
import os
|
|
301
|
+
os.remove("test.txt")
|
|
302
|
+
|
|
303
|
+
if __name__ == "__main__":
|
|
304
|
+
test_basic()
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Run it:
|
|
308
|
+
```bash
|
|
309
|
+
python test_markitdown.py
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
## Getting Help
|
|
313
|
+
|
|
314
|
+
- **Documentation**: See `SKILL.md` and `README.md`
|
|
315
|
+
- **GitHub Issues**: https://github.com/microsoft/markitdown/issues
|
|
316
|
+
- **Examples**: `assets/example_usage.md`
|
|
317
|
+
- **API Reference**: `references/api_reference.md`
|
|
318
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# OpenRouter Integration for MarkItDown
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This MarkItDown skill has been configured to use **OpenRouter** instead of direct OpenAI API access. OpenRouter provides a unified API gateway to access 100+ AI models from different providers through a single, OpenAI-compatible interface.
|
|
6
|
+
|
|
7
|
+
## Why OpenRouter?
|
|
8
|
+
|
|
9
|
+
### Benefits
|
|
10
|
+
|
|
11
|
+
1. **Multiple Model Access**: Access GPT-4, Claude, Gemini, and 100+ other models through one API
|
|
12
|
+
2. **No Vendor Lock-in**: Switch between models without code changes
|
|
13
|
+
3. **Competitive Pricing**: Often better rates than going direct
|
|
14
|
+
4. **Simple Migration**: OpenAI-compatible API means minimal code changes
|
|
15
|
+
5. **Flexible Choice**: Choose the best model for each task
|
|
16
|
+
|
|
17
|
+
### Popular Models for Image Description
|
|
18
|
+
|
|
19
|
+
| Model | Provider | Use Case | Vision Support |
|
|
20
|
+
|-------|----------|----------|----------------|
|
|
21
|
+
| `anthropic/claude-sonnet-4.5` | Anthropic | **Recommended** - Best overall for scientific analysis | ✅ |
|
|
22
|
+
| `anthropic/claude-3.5-sonnet` | Anthropic | Excellent technical analysis | ✅ |
|
|
23
|
+
| `openai/gpt-4o` | OpenAI | Strong vision understanding | ✅ |
|
|
24
|
+
| `openai/gpt-4-vision` | OpenAI | GPT-4 with vision | ✅ |
|
|
25
|
+
| `google/gemini-pro-vision` | Google | Cost-effective option | ✅ |
|
|
26
|
+
|
|
27
|
+
See https://openrouter.ai/models for the complete list.
|
|
28
|
+
|
|
29
|
+
## Getting Started
|
|
30
|
+
|
|
31
|
+
### 1. Get an API Key
|
|
32
|
+
|
|
33
|
+
1. Visit https://openrouter.ai/keys
|
|
34
|
+
2. Sign up or log in
|
|
35
|
+
3. Create a new API key
|
|
36
|
+
4. Copy the key (starts with `sk-or-v1-...`)
|
|
37
|
+
|
|
38
|
+
### 2. Set Environment Variable
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Add to your environment
|
|
42
|
+
export OPENROUTER_API_KEY="sk-or-v1-..."
|
|
43
|
+
|
|
44
|
+
# Make it permanent
|
|
45
|
+
echo 'export OPENROUTER_API_KEY="sk-or-v1-..."' >> ~/.zshrc # macOS
|
|
46
|
+
echo 'export OPENROUTER_API_KEY="sk-or-v1-..."' >> ~/.bashrc # Linux
|
|
47
|
+
|
|
48
|
+
# Reload shell
|
|
49
|
+
source ~/.zshrc # or source ~/.bashrc
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 3. Use in Python
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from markitdown import MarkItDown
|
|
56
|
+
from openai import OpenAI
|
|
57
|
+
|
|
58
|
+
# Initialize OpenRouter client (OpenAI-compatible)
|
|
59
|
+
client = OpenAI(
|
|
60
|
+
api_key="your-openrouter-api-key", # or use env var
|
|
61
|
+
base_url="https://openrouter.ai/api/v1"
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
# Create MarkItDown with AI support
|
|
65
|
+
md = MarkItDown(
|
|
66
|
+
llm_client=client,
|
|
67
|
+
llm_model="anthropic/claude-sonnet-4.5" # Choose your model
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
# Convert with AI-enhanced descriptions
|
|
71
|
+
result = md.convert("presentation.pptx")
|
|
72
|
+
print(result.text_content)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Using the Scripts
|
|
76
|
+
|
|
77
|
+
All skill scripts have been updated to use OpenRouter:
|
|
78
|
+
|
|
79
|
+
### convert_with_ai.py
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Set API key
|
|
83
|
+
export OPENROUTER_API_KEY="sk-or-v1-..."
|
|
84
|
+
|
|
85
|
+
# Convert with default model (Claude Sonnet 4.5)
|
|
86
|
+
python scripts/convert_with_ai.py paper.pdf output.md --prompt-type scientific
|
|
87
|
+
|
|
88
|
+
# Use GPT-4o as alternative
|
|
89
|
+
python scripts/convert_with_ai.py paper.pdf output.md \
|
|
90
|
+
--model openai/gpt-4o \
|
|
91
|
+
--prompt-type scientific
|
|
92
|
+
|
|
93
|
+
# Use Gemini Pro Vision (cost-effective)
|
|
94
|
+
python scripts/convert_with_ai.py slides.pptx output.md \
|
|
95
|
+
--model google/gemini-pro-vision \
|
|
96
|
+
--prompt-type presentation
|
|
97
|
+
|
|
98
|
+
# List available prompt types
|
|
99
|
+
python scripts/convert_with_ai.py --list-prompts
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Choosing the Right Model
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# For scientific papers - use Claude Sonnet 4.5 for technical analysis
|
|
106
|
+
python scripts/convert_with_ai.py research.pdf output.md \
|
|
107
|
+
--model anthropic/claude-sonnet-4.5 \
|
|
108
|
+
--prompt-type scientific
|
|
109
|
+
|
|
110
|
+
# For presentations - use Claude Sonnet 4.5 for vision
|
|
111
|
+
python scripts/convert_with_ai.py slides.pptx output.md \
|
|
112
|
+
--model anthropic/claude-sonnet-4.5 \
|
|
113
|
+
--prompt-type presentation
|
|
114
|
+
|
|
115
|
+
# For data visualizations - use Claude Sonnet 4.5
|
|
116
|
+
python scripts/convert_with_ai.py charts.pdf output.md \
|
|
117
|
+
--model anthropic/claude-sonnet-4.5 \
|
|
118
|
+
--prompt-type data_viz
|
|
119
|
+
|
|
120
|
+
# For medical images - use Claude Sonnet 4.5 for detailed analysis
|
|
121
|
+
python scripts/convert_with_ai.py xray.jpg output.md \
|
|
122
|
+
--model anthropic/claude-sonnet-4.5 \
|
|
123
|
+
--prompt-type medical
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Code Examples
|
|
127
|
+
|
|
128
|
+
### Basic Usage
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from markitdown import MarkItDown
|
|
132
|
+
from openai import OpenAI
|
|
133
|
+
import os
|
|
134
|
+
|
|
135
|
+
# Initialize OpenRouter client
|
|
136
|
+
client = OpenAI(
|
|
137
|
+
api_key=os.environ.get("OPENROUTER_API_KEY"),
|
|
138
|
+
base_url="https://openrouter.ai/api/v1"
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
# Use Claude Sonnet 4.5 for image descriptions
|
|
142
|
+
md = MarkItDown(
|
|
143
|
+
llm_client=client,
|
|
144
|
+
llm_model="anthropic/claude-sonnet-4.5"
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
result = md.convert("document.pptx")
|
|
148
|
+
print(result.text_content)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Switching Models Dynamically
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
from markitdown import MarkItDown
|
|
155
|
+
from openai import OpenAI
|
|
156
|
+
import os
|
|
157
|
+
|
|
158
|
+
client = OpenAI(
|
|
159
|
+
api_key=os.environ["OPENROUTER_API_KEY"],
|
|
160
|
+
base_url="https://openrouter.ai/api/v1"
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
# Use different models for different file types
|
|
164
|
+
def convert_with_best_model(filepath):
|
|
165
|
+
if filepath.endswith('.pdf'):
|
|
166
|
+
# Use Claude Sonnet 4.5 for technical PDFs
|
|
167
|
+
md = MarkItDown(
|
|
168
|
+
llm_client=client,
|
|
169
|
+
llm_model="anthropic/claude-sonnet-4.5",
|
|
170
|
+
llm_prompt="Describe scientific figures with technical precision"
|
|
171
|
+
)
|
|
172
|
+
elif filepath.endswith('.pptx'):
|
|
173
|
+
# Use Claude Sonnet 4.5 for presentations
|
|
174
|
+
md = MarkItDown(
|
|
175
|
+
llm_client=client,
|
|
176
|
+
llm_model="anthropic/claude-sonnet-4.5",
|
|
177
|
+
llm_prompt="Describe slide content and visual elements"
|
|
178
|
+
)
|
|
179
|
+
else:
|
|
180
|
+
# Use Claude Sonnet 4.5 as default
|
|
181
|
+
md = MarkItDown(
|
|
182
|
+
llm_client=client,
|
|
183
|
+
llm_model="anthropic/claude-sonnet-4.5"
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
return md.convert(filepath)
|
|
187
|
+
|
|
188
|
+
# Use it
|
|
189
|
+
result = convert_with_best_model("paper.pdf")
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Custom Prompts per Model
|
|
193
|
+
|
|
194
|
+
```python
|
|
195
|
+
from markitdown import MarkItDown
|
|
196
|
+
from openai import OpenAI
|
|
197
|
+
|
|
198
|
+
client = OpenAI(
|
|
199
|
+
api_key="your-openrouter-api-key",
|
|
200
|
+
base_url="https://openrouter.ai/api/v1"
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
# Scientific analysis with Claude Sonnet 4.5
|
|
204
|
+
scientific_prompt = """
|
|
205
|
+
Analyze this scientific figure. Provide:
|
|
206
|
+
1. Type of visualization and methodology
|
|
207
|
+
2. Quantitative data points and trends
|
|
208
|
+
3. Statistical significance
|
|
209
|
+
4. Technical interpretation
|
|
210
|
+
Be precise and use scientific terminology.
|
|
211
|
+
"""
|
|
212
|
+
|
|
213
|
+
md_scientific = MarkItDown(
|
|
214
|
+
llm_client=client,
|
|
215
|
+
llm_model="anthropic/claude-sonnet-4.5",
|
|
216
|
+
llm_prompt=scientific_prompt
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
# Visual analysis with Claude Sonnet 4.5
|
|
220
|
+
visual_prompt = """
|
|
221
|
+
Describe this image comprehensively:
|
|
222
|
+
1. Main visual elements and composition
|
|
223
|
+
2. Colors, layout, and design
|
|
224
|
+
3. Text and labels
|
|
225
|
+
4. Overall message
|
|
226
|
+
"""
|
|
227
|
+
|
|
228
|
+
md_visual = MarkItDown(
|
|
229
|
+
llm_client=client,
|
|
230
|
+
llm_model="anthropic/claude-sonnet-4.5",
|
|
231
|
+
llm_prompt=visual_prompt
|
|
232
|
+
)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Model Comparison
|
|
236
|
+
|
|
237
|
+
### For Scientific Content
|
|
238
|
+
|
|
239
|
+
**Recommended: anthropic/claude-sonnet-4.5**
|
|
240
|
+
- Excellent at technical analysis
|
|
241
|
+
- Superior reasoning capabilities
|
|
242
|
+
- Best at understanding scientific figures
|
|
243
|
+
- Most detailed and accurate explanations
|
|
244
|
+
- Advanced vision capabilities
|
|
245
|
+
|
|
246
|
+
**Alternative: openai/gpt-4o**
|
|
247
|
+
- Good vision understanding
|
|
248
|
+
- Fast processing
|
|
249
|
+
- Good at charts and graphs
|
|
250
|
+
|
|
251
|
+
### For Presentations
|
|
252
|
+
|
|
253
|
+
**Recommended: anthropic/claude-sonnet-4.5**
|
|
254
|
+
- Superior vision capabilities
|
|
255
|
+
- Excellent at understanding slide layouts
|
|
256
|
+
- Fast and reliable
|
|
257
|
+
- Best technical comprehension
|
|
258
|
+
|
|
259
|
+
### For Cost-Effectiveness
|
|
260
|
+
|
|
261
|
+
**Recommended: google/gemini-pro-vision**
|
|
262
|
+
- Lower cost per request
|
|
263
|
+
- Good quality
|
|
264
|
+
- Fast processing
|
|
265
|
+
|
|
266
|
+
## Pricing Considerations
|
|
267
|
+
|
|
268
|
+
OpenRouter pricing varies by model. Check current rates at https://openrouter.ai/models
|
|
269
|
+
|
|
270
|
+
**Tips for Cost Optimization:**
|
|
271
|
+
1. Use Claude Sonnet 4.5 for best quality on complex scientific content
|
|
272
|
+
2. Use cheaper models (Gemini) for simple images
|
|
273
|
+
3. Batch process similar content with the same model
|
|
274
|
+
4. Use appropriate prompts to get better results in fewer retries
|
|
275
|
+
|
|
276
|
+
## Troubleshooting
|
|
277
|
+
|
|
278
|
+
### API Key Issues
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
# Check if key is set
|
|
282
|
+
echo $OPENROUTER_API_KEY
|
|
283
|
+
|
|
284
|
+
# Should show: sk-or-v1-...
|
|
285
|
+
# If empty, set it:
|
|
286
|
+
export OPENROUTER_API_KEY="sk-or-v1-..."
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Model Not Found
|
|
290
|
+
|
|
291
|
+
If you get a "model not found" error, check:
|
|
292
|
+
1. Model name format: `provider/model-name`
|
|
293
|
+
2. Model availability: https://openrouter.ai/models
|
|
294
|
+
3. Vision support: Ensure model supports vision for image description
|
|
295
|
+
|
|
296
|
+
### Rate Limits
|
|
297
|
+
|
|
298
|
+
OpenRouter has rate limits. If you hit them:
|
|
299
|
+
1. Add delays between requests
|
|
300
|
+
2. Use batch processing scripts with `--workers` parameter
|
|
301
|
+
3. Consider upgrading your OpenRouter plan
|
|
302
|
+
|
|
303
|
+
## Migration Notes
|
|
304
|
+
|
|
305
|
+
This skill was updated from direct OpenAI API to OpenRouter. Key changes:
|
|
306
|
+
|
|
307
|
+
1. **Environment Variable**: `OPENAI_API_KEY` → `OPENROUTER_API_KEY`
|
|
308
|
+
2. **Client Initialization**: Added `base_url="https://openrouter.ai/api/v1"`
|
|
309
|
+
3. **Model Names**: `gpt-4o` → `openai/gpt-4o` (with provider prefix)
|
|
310
|
+
4. **Script Updates**: All scripts now use OpenRouter by default
|
|
311
|
+
|
|
312
|
+
## Resources
|
|
313
|
+
|
|
314
|
+
- **OpenRouter Website**: https://openrouter.ai
|
|
315
|
+
- **Get API Keys**: https://openrouter.ai/keys
|
|
316
|
+
- **Model List**: https://openrouter.ai/models
|
|
317
|
+
- **Pricing**: https://openrouter.ai/models (click on model for details)
|
|
318
|
+
- **Documentation**: https://openrouter.ai/docs
|
|
319
|
+
- **Support**: https://openrouter.ai/discord
|
|
320
|
+
|
|
321
|
+
## Example Workflow
|
|
322
|
+
|
|
323
|
+
Here's a complete workflow using OpenRouter:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
# 1. Set up API key
|
|
327
|
+
export OPENROUTER_API_KEY="sk-or-v1-your-key-here"
|
|
328
|
+
|
|
329
|
+
# 2. Convert a scientific paper with Claude
|
|
330
|
+
python scripts/convert_with_ai.py \
|
|
331
|
+
research_paper.pdf \
|
|
332
|
+
output.md \
|
|
333
|
+
--model anthropic/claude-3.5-sonnet \
|
|
334
|
+
--prompt-type scientific
|
|
335
|
+
|
|
336
|
+
# 3. Convert presentation with GPT-4o
|
|
337
|
+
python scripts/convert_with_ai.py \
|
|
338
|
+
talk_slides.pptx \
|
|
339
|
+
slides.md \
|
|
340
|
+
--model openai/gpt-4o \
|
|
341
|
+
--prompt-type presentation
|
|
342
|
+
|
|
343
|
+
# 4. Batch convert with cost-effective model
|
|
344
|
+
python scripts/batch_convert.py \
|
|
345
|
+
images/ \
|
|
346
|
+
markdown_output/ \
|
|
347
|
+
--extensions .jpg .png
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
## Support
|
|
351
|
+
|
|
352
|
+
For OpenRouter-specific issues:
|
|
353
|
+
- Discord: https://openrouter.ai/discord
|
|
354
|
+
- Email: support@openrouter.ai
|
|
355
|
+
|
|
356
|
+
For MarkItDown skill issues:
|
|
357
|
+
- Check documentation in this skill directory
|
|
358
|
+
- Review examples in `assets/example_usage.md`
|
|
359
|
+
|