A powerful, cross-platform Python application for extracting, processing, and exporting tasks from the ClickUp API with beautiful console interfaces and AI-powered summaries.
- π Secure Authentication: Multiple authentication methods including 1Password integration
- π¨ Beautiful UI: Rich console interfaces with progress bars, panels, and styled output
- π€ AI Summaries: Optional Google Gemini AI integration for intelligent task summaries
- π Multiple Export Formats: CSV, HTML, Markdown, PDF, or combined formats with professional styling
- π Interactive Mode: Review and select tasks before export
- π Flexible Filtering: Date range filtering (This Week, Last Week, All Open)
- π Cross-Platform: Works on Windows, macOS, and Linux
- β‘ Modern Architecture: Clean, modular design following SOLID principles
- Python 3.11 or higher
- ClickUp API token
- Optional: 1Password CLI or SDK for secure credential management
- Optional: Google Gemini API key for AI summaries
-
Clone the repository:
git clone https://github.com/J-MaFf/clickup_task_extractor.git cd clickup_task_extractor -
Install dependencies:
pip install -r requirements.txt
-
Set up your ClickUp API key (choose one method):
- Command line:
python main.py --api-key YOUR_API_KEY - Environment variable:
export CLICKUP_API_KEY=YOUR_API_KEY - 1Password: Store in 1Password with reference
op://Home Server/ClickUp personal API token/credential
- Command line:
# Run with default settings (HTML output, KMS workspace, Kikkoman space)
python main.py
# Interactive mode - review tasks before export
python main.py --interactive
# Export specific formats
python main.py --output-format Markdown
python main.py --output-format PDF
python main.py --output-format Both # CSV + HTML
# Include completed tasks
python main.py --include-completed
# Filter by date range
python main.py --date-filter ThisWeek
# Custom workspace and space
python main.py --workspace "MyWorkspace" --space "MySpace"| Option | Description | Default |
|---|---|---|
--api-key |
ClickUp API key | From environment or 1Password |
--workspace |
Workspace name | KMS |
--space |
Space name | Kikkoman |
--output |
Output file path | Auto-generated timestamp |
--output-format |
Export format: CSV, Markdown, PDF, Both |
HTML |
--include-completed |
Include completed/archived tasks | False |
--interactive |
Enable interactive task selection | Prompted |
--date-filter |
Date filter: AllOpen, ThisWeek, LastWeek |
AllOpen |
--ai-summary |
Enable AI summaries | Prompted |
--gemini-api-key |
Google Gemini API key | From 1Password |
- Command Line Argument:
--api-key YOUR_KEY - Environment Variable:
CLICKUP_API_KEY=YOUR_KEY - 1Password SDK: Requires
OP_SERVICE_ACCOUNT_TOKENenvironment variable - 1Password CLI: Requires
opcommand in PATH - Manual Input: Prompted during execution
For secure credential management, store your API keys in 1Password:
- ClickUp API Key:
op://Home Server/ClickUp personal API token/credential - Gemini API Key:
op://Home Server/nftoo3gsi3wpx7z5bdmcsvr7p4/credential
Set up 1Password SDK:
export OP_SERVICE_ACCOUNT_TOKEN=your_service_account_tokenThe project follows a clean, modular architecture:
clickup_task_extractor/
βββ main.py # Entry point and CLI parsing
βββ config.py # Configuration and data models
βββ auth.py # Authentication and 1Password integration
βββ api_client.py # ClickUp API client with error handling
βββ extractor.py # Main business logic and export functionality
βββ ai_summary.py # Google Gemini AI integration
βββ mappers.py # Data mapping and utility functions
βββ logger_config.py # Logging configuration
βββ requirements.txt # Python dependencies
βββ output/ # Generated export files
ClickUpConfig: Type-safe configuration with enum-based optionsTaskRecord: Structured data model for exported tasksAPIClient: Protocol-based HTTP client for ClickUp APIClickUpTaskExtractor: Main orchestrator following single responsibility principle- Rich Console Integration: Beautiful progress bars, tables, and panels
# Type-safe configuration pattern
config = ClickUpConfig(
output_format=OutputFormat.HTML, # Enum-based for type safety
date_filter=DateFilter.THIS_WEEK
)
# Protocol-based dependency injection
def process_tasks(client: APIClient) -> list[TaskRecord]:
return client.get("/tasks")
# Context manager for safe file operations
with export_file(output_path, 'w') as f:
writer = csv.DictWriter(f, fieldnames=fields)- SOLID Principles: Modular architecture with single responsibility
- Modern Type Hints: Uses
list[T],dict[K,V],str | Nonesyntax - Error Handling: Specific exceptions with proper chaining
- Resource Management: Context managers for file operations
- Cross-Platform: Uses
pathlibfor file operations
- New export fields: Update
TaskRecorddataclass inconfig.py - New output formats: Extend
exportmethod inextractor.py - New authentication methods: Extend authentication chain in
auth.py - New custom field mappings: Extend
LocationMapperclass inmappers.py
- Professional-looking HTML tables with CSS styling
- Task summaries with status, priority, and custom fields
- Cross-platform date formatting (e.g., "8/1/2025 at 3:45 PM")
- Image extraction from task descriptions
- Standard CSV format compatible with Excel and other tools
- All task fields including custom field mappings
- Configurable field exclusions
- Rich console interface for task review
- Filter and select specific tasks before export
- Real-time progress indicators
Optional Google Gemini AI integration provides:
- Intelligent 1-2 sentence task summaries
- Automatic rate limiting and retry logic
- Graceful fallback to original content if AI fails
Enable AI summaries:
python main.py --ai-summary --gemini-api-key YOUR_KEYrequests>=2.25.0- HTTP client for ClickUp APIrich>=14.0.0- Beautiful console interfaces
onepassword-sdk>=0.3.1- Secure credential managementgoogle-generativeai>=0.8.0- AI-powered task summaries
Authentication Errors:
- Verify your ClickUp API key is valid
- Check 1Password integration setup
- Ensure environment variables are set correctly
Import Errors:
- Install dependencies:
pip install -r requirements.txt - Check Python version (3.11+ required)
- Verify virtual environment activation
API Rate Limiting:
- AI summaries include automatic retry logic
- Reduce concurrent requests if needed
Enable detailed logging:
from logger_config import setup_logging
import logging
logger = setup_logging(logging.DEBUG, "debug.log")- Fork the repository
- Create a feature branch:
git checkout -b feat/new-feature - Follow the existing code style and architecture patterns
- Add tests for new functionality
- Update documentation as needed
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Rich for beautiful console output
- Uses 1Password SDK for secure credential management
- Powered by Google Gemini AI for intelligent summaries
- Integrates with ClickUp API v2 for task management
Made with β€οΈ for productivity and beautiful code