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 with user-friendly prompts
- π Interactive Format Selection: Choose output format at runtime via intuitive prompt
- π 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
-
(Windows, for PDF export) Install WeasyPrint runtime libraries (Cairo, Pango, etc.). The simplest option is the GTK3 bundle:
winget install Gnome.Project.Gtk3
Alternatively, download the GTK3 Runtime installer from tschoonj/GTK-for-Windows-Runtime-Environment-Installer and let it add the DLLs to your PATH.
-
Install WeasyPrint inside the virtual environment (if you plan to export PDFs):
python -m pip install weasyprint
-
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:
π‘ The CLI auto-relaunches inside
.venv/when present, so activating the virtualenv manually is optional as long as dependencies live there.
For users who prefer not to install Python, pre-built executables are available:
- Download
ClickUpTaskExtractor.exefrom the latest release - Run directly:
ClickUpTaskExtractor.exeor from command line with options - No Python installation requiredβall dependencies are bundled
Authentication for Executable Users:
The executable version does not include the 1Password SDK (due to bundling limitations). You have three options:
-
Environment Variable (Recommended):
set CLICKUP_API_KEY=your_api_key_here ClickUpTaskExtractor.exe -
Command Line Argument:
ClickUpTaskExtractor.exe --api-key your_api_key_here
-
1Password CLI (Advanced): Install the 1Password CLI and ensure it's in your PATH:
# The executable will automatically try to use 'op read' command ClickUpTaskExtractor.exe
Example:
ClickUpTaskExtractor.exe --output-format Both --interactive# 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"When certain options are not specified via CLI arguments, the application will prompt you interactively:
- Interactive Mode: Asks if you want to review and select which tasks to export
- AI Summary: Asks if you want to enable AI-powered task summaries (requires Gemini API key)
- Output Format: Asks you to choose your preferred export format (CSV, HTML, Markdown, PDF, or Both)
Each prompt provides clear options and defaults, making it easy to configure the application on-the-fly without remembering all CLI flags.
- Install deps via
pip install -r requirements.txt; optional features requireonepassword-sdkandgoogle-generativeaiwhich are already listed. - Run the extractor with
python main.py(defaults: workspaceKMS, spaceKikkoman, HTML export). Override with--output-format,--interactive,--include-completed,--date-filter,--ai-summary, and--gemini-api-key. - Authentication falls back in this order: CLI flag β env var
CLICKUP_API_KEYβ 1Password SDK (requiresOP_SERVICE_ACCOUNT_TOKEN) βop readCLI β manual prompt. - Logging comes from
logger_config.setup_logging; passuse_rich=Falsefor plain output or alog_filepath to persist logs. - All exports land under
output/, named withdefault_output_path()which strips leading zeros for cross-platform friendly filenames.
- Add export fields: Extend
TaskRecordinconfig.py, updateget_export_fields(), and ensure HTML/Markdown renderers display the new column. - New output formats: Add an
OutputFormatenum value, surface it in CLI choices, and implement the exporter insideClickUpTaskExtractor.export()usingexport_file(). - Custom filtering or mapping: Hook into
_fetch_and_process_tasks(), reuseget_date_range(), and lean onLocationMapper.map_location()for dropdowns. - Authentication tweaks: Keep changes inside
load_secret_with_fallback()so logging and fallback order stay consistent.
| 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 |
Prompted if not specified, defaults to 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: Uses
op readcommand - Manual Prompt: Rich console input as the final fallback
- Command Line Argument:
--api-key YOUR_KEY - Environment Variable:
CLICKUP_API_KEY=YOUR_KEY - 1Password CLI: Uses
op readcommand (SDK not available in EXE) - Manual Prompt: Rich console input as the final fallback
Note: The 1Password SDK cannot be bundled in the executable due to native dependencies. EXE users should use environment variables, command line arguments, or install the 1Password CLI separately.
Store secrets in 1Password for reuse:
- ClickUp API key:
op://Home Server/ClickUp personal API token/credential - Gemini API key:
op://Home Server/nftoo3gsi3wpx7z5bdmcsvr7p4/credential
For Python users with 1Password SDK:
export OP_SERVICE_ACCOUNT_TOKEN=your_service_account_tokenclickup_task_extractor/
βββ main.py # CLI entry, venv handoff, config assembly, auth chain
βββ config.py # Enum config, TaskRecord dataclass, datetime helpers
βββ auth.py # 1Password SDK/CLI loader with structured logging
βββ api_client.py # APIClient protocol + ClickUpAPIClient (requests, 30 s timeout)
βββ extractor.py # ClickUpTaskExtractor workflow, exports, interactive UI
βββ ai_summary.py # Gemini summaries with retry/backoff and graceful fallback
βββ mappers.py # Prompts, date filters, dropdown mapping, image extraction
βββ logger_config.py # Rich-enhanced logging setup and helper accessor
βββ requirements.txt # Dependency manifest
βββ output/ # Generated reports (HTML/CSV/Markdown/PDF)
main.py: BuildsClickUpConfig, orchestrates auth fallback, and prompts for interactive mode/AI summaries.ClickUpConfig&TaskRecord: Enum-backed config (string-friendly fallbacks) plus an export dataclass whose_metadatastores raw task content for AI summaries.ClickUpTaskExtractor: Walks workspace β space β lists β tasks, caches custom fields, filters by status/date, and usesexport_file()for all I/O.LocationMapperutilities: Map dropdown IDs via id β orderindex β name priority, extract images, and provide consistent yes/no prompts.ai_summary.get_ai_summary: Talks togemini-2.5-flash-lite, parses retry hints, and falls back to original text if the SDK or key is missing.logger_config.setup_logging: Installs Rich tracebacks, emits to stdout, and optionally writes to disk.
- Professional-looking HTML tables with CSS styling
- Task summaries with status, priority, and custom fields
- Cross-platform date formatting (e.g., "10/7/2025 at 3:45 PM" for October 7, 2025 - MM/DD/YYYY format)
- 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_KEYImplementation details:
- Uses
gemini-2.5-flash-litevia the officialgoogle-generativeaiSDK. - Retries up to three times on 429s, parsing
retryDelayhints when available and showing Rich progress while waiting. - Falls back to raw subject/description/resolution text when the SDK is missing or the key is unavailable.
requests>=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
1Password Integration (Executable Users):
If you see errors like "1Password SDK not available" or "op command not found" when using the executable:
-
Using Environment Variables (Easiest):
# Windows Command Prompt set CLICKUP_API_KEY=your_api_key_here ClickUpTaskExtractor.exe # Windows PowerShell $env:CLICKUP_API_KEY="your_api_key_here" .\ClickUpTaskExtractor.exe
-
Using Command Line Argument:
ClickUpTaskExtractor.exe --api-key your_api_key_here
-
Using 1Password CLI (if you prefer 1Password):
- Install 1Password CLI from: https://developer.1password.com/docs/cli/get-started/
- Ensure
opcommand is in your PATH - The executable will automatically use it
Note: The 1Password SDK is only available when running the Python version, not the compiled executable. This is a known limitation due to native dependencies.
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