AI-powered documentation generator with multi-LLM support and Notion integration
- π€ Multi-LLM Support - Choose from OpenAI, Claude, Gemini, DeepSeek, or local models (Ollama)
- π Automatic Code Analysis - Extracts classes, functions, APIs from your codebase
- π Enterprise Templates - 4 professional doc templates for different audiences
- π Safe Updates - Automatic backup before overwriting Notion pages
- π Merge Mode - Preserves existing content when updating
- π° Cost Flexibility - From premium (GPT-4) to ultra-cheap (DeepSeek) to free (Ollama)
# Basic installation (OpenAI + DeepSeek support)
pip install notion-scriba
# With Anthropic Claude support
pip install notion-scriba[anthropic]
# With Google Gemini support
pip install notion-scriba[google]
# With all providers
pip install notion-scriba[all]
# From source
git clone https://github.com/dbaldoni/notion-scriba
cd notion-scriba
pip install -e .Option 1: Interactive Setup (Recommended) π―
# Run the setup wizard
scriba-setup
# Follow the prompts to:
# 1. Enter your Notion integration token
# 2. Choose Pages or Database mode
# 3. Enter your page/database IDs
# 4. Validate connection
# 5. Save configurationOption 2: Manual Setup π
- Copy
.env.exampleto.env:
cp .env.example .env- Add your credentials:
# Notion configuration
NOTION_TOKEN=secret_your-token-here
NOTION_PAGE_ID=your-page-id # For single page mode
NOTION_DB=your-database-id # For database mode
# Choose your LLM provider
LLM_PROVIDER=openai # or: anthropic, google, deepseek, ollama
OPENAI_API_KEY=sk-your-key-here- See detailed setup guide: docs/notion_setup.md
# Generate documentation for a component
scriba --component myapp --template technical-deep-dive
# Use different LLM provider
scriba --provider anthropic --model claude-3-5-sonnet-20241022 \
--component myapp
# Cost-effective option with DeepSeek
scriba --provider deepseek --component myapp
# Completely free with local Ollama
scriba --provider ollama --model llama3.1 --component myapp
# Interactive mode with file autocomplete
scriba -i
# Quick mode with custom prompt
scriba --quick "Generate API documentation for authentication module"| Provider | Models | Pricing | Best For |
|---|---|---|---|
| OpenAI | GPT-4o, GPT-4-turbo, GPT-3.5 | $5-15/1M tokens | Premium quality |
| Anthropic | Claude 3.5 Sonnet, Opus, Haiku | $3-15/1M tokens | Long context |
| Gemini 1.5 Pro, Flash | Free tier, then $1-7/1M | Cost-effective | |
| DeepSeek | DeepSeek Chat, Coder | $0.14-0.28/1M tokens | Ultra cheap |
| Ollama | Llama 3.1, Mistral, CodeLlama | FREE (local) | Privacy & offline |
OpenAI (GPT-4, GPT-4o)
# Get API key from: https://platform.openai.com/api-keys
export OPENAI_API_KEY="sk-your-key-here"
scriba --provider openai --model gpt-4o --component myappAnthropic (Claude)
# Install: pip install notion-scriba[anthropic]
# Get API key from: https://console.anthropic.com/
export ANTHROPIC_API_KEY="sk-ant-your-key-here"
scriba --provider anthropic --model claude-3-5-sonnet-20241022 --component myappGoogle (Gemini)
# Install: pip install notion-scriba[google]
# Get API key from: https://makersuite.google.com/app/apikey
export GOOGLE_API_KEY="your-key-here"
scriba --provider google --model gemini-1.5-pro --component myappDeepSeek (Cost-Effective)
# Get API key from: https://platform.deepseek.com/
export DEEPSEEK_API_KEY="your-key-here"
scriba --provider deepseek --model deepseek-chat --component myappOllama (Local & Free)
# Install Ollama from: https://ollama.ai
# Pull model: ollama pull llama3.1
# Start Ollama: ollama serve
scriba --provider ollama --model llama3.1 --component myappFor investors, C-level executives, board members
- Business impact and ROI
- Market positioning
- Competitive advantages
- Risk assessment
For senior developers, architects, technical leads
- Architecture diagrams
- Implementation details
- Performance characteristics
- Integration patterns
For product managers, business analysts, stakeholders
- Use cases and workflows
- User benefits
- Cost savings
- Success metrics
For integration engineers, external developers
- Endpoint reference
- Authentication flow
- Code examples
- Error handling
scriba [OPTIONS]
Options:
# Component & Template
--component TEXT Component to document (e.g., authentication, api, dashboard)
--template CHOICE Template: investment-grade, technical-deep-dive,
business-value, api-documentation
# LLM Configuration
--provider CHOICE LLM provider: openai, anthropic, google, deepseek, ollama
--model TEXT Model name (default: provider-specific)
--api-key TEXT API key (or use environment variable)
--temperature FLOAT Generation temperature 0.0-1.0 (default: 0.3)
--max-tokens INT Maximum tokens to generate (default: 4000)
# Workflow Options
--interactive, -i Interactive mode with file autocomplete
--quick TEXT Quick mode with direct prompt
--no-refine Skip interactive prompt refinement
--auto-code-analysis Enable automatic code analysis
--no-code-analysis Disable code analysis
# Information
--list-providers Show available LLM providers
--help Show this help messageNotion Scriba is released under the GNU General Public License v3.0 (GPLv3). You are free to use, modify, and distribute this software, but any distributed modified versions must also be licensed under GPLv3.
See the full license in the LICENSE file.
notion-scriba/
βββ src/notion_scriba/
β βββ llm/ # Multi-LLM abstraction layer
β β βββ base.py # Abstract base class
β β βββ factory.py # Provider factory
β β βββ openai_provider.py
β β βββ anthropic_provider.py
β β βββ google_provider.py
β β βββ deepseek_provider.py
β β βββ ollama_provider.py
β βββ code_analyzer.py # Source code analysis
β βββ doc_generator.py # Documentation generation
β βββ notion_client.py # Notion API integration
β βββ templates.py # Documentation templates
β βββ interactive_mode.py # Interactive file selector
β βββ setup_wizard.py # Configuration wizard
β βββ cli.py # Command-line interface
βββ tests/ # Test suite
βββ docs/ # Documentation
βββ examples/ # Usage examples
from notion_scriba import DocGenerator
generator = DocGenerator(provider="openai", model="gpt-4o")
custom_prompt = """
Generate documentation for {component} that includes:
1. Executive summary
2. Technical specifications
3. Usage examples
4. Performance benchmarks
"""
result = generator.generate(
component="authentication",
prompt=custom_prompt,
temperature=0.4
)from notion_scriba.llm import LLMProviderFactory, LLMConfig
# Initialize provider
config = LLMConfig(
api_key="your-key",
model="gpt-4o",
temperature=0.3,
max_tokens=4000
)
provider = LLMProviderFactory.create("openai", config)
# Generate documentation
response = provider.generate(
prompt="Write technical documentation for...",
system_prompt="You are an expert technical writer..."
)
print(response)# Clone repository
git clone https://github.com/dbaldoni/notion-scriba
cd notion-scriba
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=notion_scriba
# Format code
black src/ tests/
# Lint
ruff check src/ tests/Contributions are welcome! Please read our CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under GPLv3. By contributing, you agree that your contributions will be licensed under the same license.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- π Documentation
- π Issue Tracker
- π¬ Discussions
ποΈ Notion Scriba
"Verba volant, scripta manent"
Made with β€οΈ by Davide Baldoni