Capcat Package
Overview
This package contains the following modules:
capcat.cli- CLI entry point for Capcatcapcat.tui- TUI entry point - delegates to core interactive modulecapcat.core.unified_article_processor- Unified Article Processor - Universal entry point for all article processingcapcat.core.image_processor- Global Image Processor for Capcatcapcat.core.source_configs- Modular source configuration system with backward compatibilitycapcat.core.timeout_config- Adaptive timeout configuration for Capcatcapcat.core.storage_manager- Storage management component for Capcatcapcat.core.streamlined_comment_processor- Streamlined comment processor for optimizing nested structure handling and reducing conversion timecapcat.core.formatter- HTML to Markdown converter for Capcatcapcat.core.command_logging- Enhanced command logging for CLI debugging and audit trailcapcat.core.config- Configuration management for Capcatcapcat.core.logging_config- Logging configuration for Capcatcapcat.core.downloader- Media downloader for Capcatcapcat.core.theme_utils- Theme utilities for hash-based theme persistencecapcat.core.article_fetcher- Shared article fetching functionality for Capcat sourcescapcat.core.retry_skip- Retry-and-Skip Logic for Network Resilience
Implements intelligent retry-and-skip mechanism for sources that timeout or refuse connection
capcat.core.unified_source_processor- Unified Source Processor for Capcatcapcat.core.network_resilience- Network Resilience Patterns for Source Processing
Clean architecture implementation applying SOLID principles:
- Single Responsibility: Each class has one clear purpose
- Open/Closed: Extensible via strategy pattern
- Liskov Substitution: RetryStrategy implementations interchangeable
- Interface Segregation: Small, focused interfaces
- Dependency Inversion: Depend on abstractions not concretions
capcat.core.session_pool- Global session pooling for optimal network performance across all sourcescapcat.core.constants- Application-wide constants for Capcatcapcat.core.content_sanitizer- Content Sanitizer - Archive isolation for Capcatcapcat.core.shutdown- Graceful shutdown handling for Capcatcapcat.core.rate_limiter- Rate limiting system for Capcat to prevent overwhelming source serverscapcat.core.ethical_scraping- Ethical scraping utilities for Capcatcapcat.core.source_config_mirror- Mirror builtin source configs to userspace Config/sources/active/capcat.core.error_handling- Comprehensive error handling and recovery system for Capcatcapcat.core.retry- Retry mechanisms with exponential backoff for Capcatcapcat.core.conversion_executor- Shared executor pool for HTML-to-Markdown conversion to prevent nested ThreadPoolExecutor deadlockcapcat.core.enhanced_argparse- Enhanced ArgumentParser with better error messages and validationcapcat.core.circuit_breaker- Circuit Breaker pattern implementation for Capcatcapcat.core.utils- Core utilities for the Capcat applicationcapcat.core.cli_validation- Enhanced CLI validation and error handling for better user experiencecapcat.core.html_post_processor- HTML Post-Processor for Capcat Archives Handles post-processing HTML generation after article scraping is completecapcat.core.interactive- Interactive mode for Capcatcapcat.core.exceptions- Custom exceptions for Capcat applicationcapcat.core.update_manager- Update Manager for Capcatcapcat.core.cli_recovery- CLI error recovery and user guidance systemcapcat.core.tui_context- TUI context flag and per-fetch result accumulationcapcat.core.progress- Progress indicators and status reporting for Capcatcapcat.core.media_processor- Media processing component for Capcatcapcat.core.source_config- Source configuration for optimized URL detection in Capcatcapcat.core.url_utils- URL validation and normalization utilities for Capcatcapcat.core.pdf_landing_resolver- Resolve direct PDF URLs to their HTML landing pages where possiblecapcat.core.design_system_compiler- Design System Compiler for Capcat HTML Generation
Compiles CSS custom properties from the design system into hardcoded values for performance optimization and self-contained HTML generation
capcat.core.media_executor- Shared executor pool for media processing to prevent nested ThreadPoolExecutor deadlockcapcat.core.timeout_wrapper- Timeout wrapper utilities for preventing hanging operationscapcat.core.media_config- Media Configuration Manager for different news sourcescapcat.core.unified_media_processor- Unified Media Processor Integration Layercapcat.core.template_renderer- Simple Template Renderer for Capcat Replaces variables with actual values from configurationcapcat.core.async_pdf_manager- Asynchronous PDF download manager to prevent thread pool exhaustioncapcat.core.date_extractor- Extract publication dates from HTML pagescapcat.htmlgen.factory- Factory for creating ArticleHTMLGenerator instancescapcat.htmlgen.generator- HTML Generator for Capcat - Static Site Generation Creates self-contained HTML files from markdown content with embedded CSS and JavaScriptcapcat.scripts.generate_source_config- Interactive script to generate comprehensive YAML configuration files for config-driven sources in Capcatcapcat.commands.fetch- Batch fetch command - processes multiple sources via the unified processorcapcat.commands.add_source- Add-source command - interactive RSS source additioncapcat.commands.remove_source- Remove-source command - interactive source removal with backup/undo supportcapcat.commands.single- Single article fetch commandcapcat.commands.generate_config- Generate-config command - launches the interactive source config generatorcapcat.commands.init- Implementation of capcat init commandcapcat.sources.builtin.custom.twitter.source- Twitter/Xcapcat.sources.builtin.custom.lb.source- Lobsters source implementation for the new source systemcapcat.sources.builtin.custom.substack.source- Substackcapcat.sources.builtin.custom.vimeo.source- Vimeo specialized source implementationcapcat.sources.builtin.custom.medium.source- Mediumcapcat.sources.builtin.custom.youtube.source- YouTube specialized source implementationcapcat.sources.builtin.custom.hn.source- Hacker News source implementation using the official Firebase APIcapcat.core.config.source_registry- Source Registry for managing all available news sources and their configurationscapcat.core.config.source_base- Base configuration classes for news sourcescapcat.core.source_system.bundle_managercapcat.core.source_system.remove_source_command- Base classes and implementations for the remove-source commandcapcat.core.source_system.add_source_command- Professional implementation of the add-source command using clean architecture principlescapcat.core.source_system.removal_ui- User interface implementation for remove-source commandcapcat.core.source_system.feed_discovery- RSS/Atom feed discovery utilitiescapcat.core.source_system.source_analytics- Source usage analytics and statisticscapcat.core.source_system.validation_engine- Enhanced configuration validation engine for the source systemcapcat.core.source_system.remove_source_service- Service layer for remove-source commandcapcat.core.source_system.add_source_service- Service layer for the add-source commandcapcat.core.source_system.bundle_models- Data models for bundle managementcapcat.core.source_system.source_factory- Source factory for creating and managing news source instancescapcat.core.source_system.performance_monitor- Source performance monitoring system for the hybrid architecturecapcat.core.source_system.bundle_validator- Bundle validation logiccapcat.core.source_system.bundle_ui- User interface components for bundle managementcapcat.core.source_system.rss_feed_introspectorcapcat.core.source_system.discovery_strategies- Discovery strategy implementations for article discoverycapcat.core.source_system.source_backup_manager- Backup and restore functionality for source configurationscapcat.core.source_system.questionary_ui- User interface implementation using questionary for interactive promptscapcat.core.source_system.config_driven_source- Config-driven source implementationcapcat.core.source_system.feed_parser- Feed parser abstraction for RSS and Atom feedscapcat.core.source_system.source_config- Source configuration system for specialized sourcescapcat.core.source_system.source_config_generatorcapcat.core.source_system.base_source- Abstract base class for all news sourcescapcat.core.source_system.source_registry- Source registry for automatic discovery and management of news sourcescapcat.core.source_system.enhanced_remove_command- Enhanced remove-source command with advanced features:- Dry-run mode
- Automatic backups
- Usage analytics
- Batch removal from file
- Undo/restore functionality
capcat.core.source_system.bundle_service- Service layer for bundle management