A Python package and CLI for generating publication-ready scientific papers, reports, posters, grant proposals, and more academic documents with Claude Sonnet 4.5. Features real-time research lookup, intelligent paper detection, and comprehensive document conversion. Version 2.0 adds a fully typed, programmatic API while keeping the CLI 100% backward compatible.
β¨ What's New in v2.4.0
- Smart File Routing - Automatic categorization of manuscript, source, data, and image files
- Enhanced Editing Mode - .tex files automatically routed to drafts/ for seamless editing
- Sources Folder - Separate folder for reference materials (.md, .docx, .pdf) to keep context organized
- Improved File Processing - Better error handling and user feedback during file operations
- Streamlined Workflow - Clearer distinction between editable manuscripts and reference materials
β¨ Previous Features (v2.0+)
- Programmatic Python API with async support
- Research lookup with Perplexity Sonar Pro
- Intelligent paper detection (auto-resume editing)
- Clinical reports (case reports, diagnostic reports, trial reports, HIPAA compliance)
- Grant proposal generation (NSF, NIH, DOE, DARPA)
- Research posters with LaTeX
- Scientific schematics (CONSORT, circuits, pathways)
- Document conversion (15+ formats with MarkItDown)
- ScholarEval peer review framework
- Python 3.10-3.12
- ANTHROPIC_API_KEY (required), OPENROUTER_API_KEY (optional for research lookup)
pip install scientific-writergit clone https://github.com/yourusername/claude-scientific-writer.git
cd claude-scientific-writer
uv sync# .env file (recommended)
echo "ANTHROPIC_API_KEY=your_key" > .env
echo "OPENROUTER_API_KEY=your_openrouter_key" >> .env
# or export in your shell
export ANTHROPIC_API_KEY='your_key'# If installed via pip
scientific-writer
# If installed from source with uv
uv run scientific-writerimport asyncio
from scientific_writer import generate_paper
async def main():
async for update in generate_paper("Create a Nature paper on CRISPR gene editing"):
if update["type"] == "progress":
print(f"[{update['percentage']}%] {update['message']}")
else:
print(f"PDF: {update['files']['pdf_final']}")
asyncio.run(main())- Scientific papers with IMRaD structure (Nature, Science, NeurIPS, etc.)
- Clinical reports (case reports, diagnostic reports, trial reports, patient documentation)
- Research posters using LaTeX (beamerposter, tikzposter, baposter)
- Grant proposals (NSF, NIH, DOE, DARPA) with agency-specific formatting
- Literature reviews with systematic citation management
- Scientific schematics (CONSORT diagrams, circuit diagrams, biological pathways)
- Real-time research lookup using Perplexity Sonar Pro (via OpenRouter)
- Intelligent paper detection - automatically identifies references to existing papers
- Peer review feedback with quantitative ScholarEval framework (8-dimension scoring)
- Iterative editing with context-aware revision suggestions
- Programmatic API - Full async Python API with type hints
- CLI interface - Interactive command-line tool with progress tracking
- Progress streaming - Real-time updates during generation
- Comprehensive results - JSON output with metadata, file paths, citations
- Automatic data handling - Drop files in
data/, auto-sorted tofigures/ordata/ - Document conversion - PDF, DOCX, PPTX, XLSX to Markdown with MarkItDown
- Bibliography management - Automatic BibTeX generation and citation formatting
- Figure integration - Images automatically referenced and organized
- Place figures and data in
data/at the project root (images βfigures/, files βdata/automatically) - Run
scientific-writerand describe what you want - Follow progress updates; outputs saved to
paper_outputs/<timestamp>_<topic>/
# Start a new paper
> Create a Nature paper on CRISPR gene editing with 5 key references
# Continue editing (automatically detected)
> Add a methods section about the experimental setup
# Reference existing paper by topic
> Find the acoustics paper and add a conclusion section
# Generate a grant proposal
> Write an NSF proposal for quantum computing research
# Create a research poster
> Generate a conference poster from my paperimport asyncio
from scientific_writer import generate_paper
async def main():
async for update in generate_paper(
query="Create a NeurIPS paper on transformers",
data_files=["results.csv", "figure.png"],
output_dir="./my_papers"
):
if update["type"] == "progress":
print(f"[{update['percentage']}%] {update['message']}")
else:
print(f"β PDF: {update['files']['pdf_final']}")
asyncio.run(main())| Task | Command Example |
|---|---|
| Scientific Paper | > Create a Nature paper on CRISPR gene editing |
| Clinical Report | > Create a clinical case report for rare disease presentation |
| Grant Proposal | > Write an NSF proposal for quantum computing research |
| Research Poster | > Generate a conference poster from my paper |
| Literature Review | > Create a literature review on machine learning in healthcare |
| Peer Review | > Evaluate this paper using the ScholarEval framework |
| Continue Editing | > Add a methods section (automatically continues current paper) |
| Find Existing Paper | > Find the acoustics paper and add a conclusion |
| New Paper | > new paper on climate change (explicitly start fresh) |
# Recent research (auto-triggers research lookup)
> Create a paper on recent advances in quantum computing (2024)
# Fact verification
> What are the current success rates for CAR-T therapy?
# Literature search
> Find 10 recent papers on transformer architectures from 2023-2024| Type | Example |
|---|---|
| Papers | Nature, Science, NeurIPS, ICML, IEEE, ACM |
| Clinical Reports | Case reports, diagnostic reports, trial reports, patient notes |
| Grants | NSF, NIH R01/R21/K, DOE, DARPA |
| Posters | Conference posters (A0, A1, custom sizes) |
| Reviews | Systematic literature reviews |
| Schematics | CONSORT diagrams, circuits, biological pathways |
# 1. Drop files in data/ folder
cp results.csv ~/Documents/claude-scientific-writer/data/
cp figure.png ~/Documents/claude-scientific-writer/data/
# 2. Files are auto-sorted:
# Images (png, jpg, svg) β figures/
# Data (csv, json, txt) β data/
# 3. Reference in paper
> Create a paper analyzing the experimental results in results.csvimport asyncio
from scientific_writer import generate_paper
# Simple usage
async for update in generate_paper("Create a Nature paper on CRISPR"):
if update["type"] == "result":
print(f"PDF: {update['files']['pdf_final']}")
# With data files
async for update in generate_paper(
query="Analyze experimental results",
data_files=["results.csv", "figure.png"],
output_dir="./papers"
):
if update["type"] == "progress":
print(f"[{update['percentage']}%] {update['message']}")- π Complete Features Guide - Comprehensive overview of all capabilities
- π§ API Reference - Full programmatic API documentation
- π― Skills Overview - All available skills and tools
- π Troubleshooting - Common issues and solutions
- π» Development Guide - Contributing and development setup
- π¦ Releasing Guide - Versioning and publishing
- π Release Notes - Version history and updates
- π€ System Instructions - Agent instructions (advanced)
Use uv and the helper scripts:
- Bump version (keeps pyproject + init in sync):
uv run scripts/bump_version.py [patch|minor|major] - Build and publish:
uv run scripts/publish.py(or--bump patch|minor|major) See docs/RELEASING.md for prerequisites, dry runs, tagging, and verification.
- CLI remains unchanged (scientific-writer).
- New programmatic API: from scientific_writer import generate_paper.
- Legacy single-file script is replaced by a proper package; no action needed for CLI users.
MIT - see LICENSE.
- Open an issue on GitHub
- See docs/TROUBLESHOOTING.md for common problems
Want to connect with other researchers, share tips, and get help in real-time? Join our vibrant Slack community! π
Whether you're writing your first paper, exploring advanced features, or just want to chat about scientific writing and AI, we'd love to have you! Get faster support, share your success stories, and collaborate with fellow users.
π Join the K-Dense Community on Slack π
We're excited to meet you! π
If you find this project helpful for your research or work, please consider giving it a star on GitHub! It helps others discover the tool and motivates continued development. Thank you! π