{"id":22352196,"url":"https://github.com/shamspias/cosmicexcuse","last_synced_at":"2025-10-14T21:31:03.034Z","repository":{"id":111763841,"uuid":"595533171","full_name":"shamspias/cosmicexcuse","owner":"shamspias","description":"🤖 Quantum-powered excuse generator for developers. Blame bugs on cosmic rays, AI sentience, or Schrödinger’s intern.","archived":false,"fork":false,"pushed_at":"2025-08-25T18:54:33.000Z","size":11,"stargazers_count":25,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-25T19:29:22.452Z","etag":null,"topics":["ai-satire","cli","cosmic","developer-tools","excuse-generator","fun","humor","markov-chains","productivity-hacks","python","quantum"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shamspias.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-31T09:26:00.000Z","updated_at":"2025-08-25T18:54:36.000Z","dependencies_parsed_at":"2023-07-24T17:00:46.292Z","dependency_job_id":null,"html_url":"https://github.com/shamspias/cosmicexcuse","commit_stats":null,"previous_names":["shamspias/cosmicexcuse"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shamspias/cosmicexcuse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamspias%2Fcosmicexcuse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamspias%2Fcosmicexcuse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamspias%2Fcosmicexcuse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamspias%2Fcosmicexcuse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shamspias","download_url":"https://codeload.github.com/shamspias/cosmicexcuse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamspias%2Fcosmicexcuse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279021373,"owners_count":26087022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-satire","cli","cosmic","developer-tools","excuse-generator","fun","humor","markov-chains","productivity-hacks","python","quantum"],"created_at":"2024-12-04T12:17:41.851Z","updated_at":"2025-10-14T21:31:03.029Z","avatar_url":"https://github.com/shamspias.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 CosmicExcuse\n\n\u003cdiv align=\"center\"\u003e\n\n[![PyPI version](https://badge.fury.io/py/cosmicexcuse.svg)](https://badge.fury.io/py/cosmicexcuse)\n[![Python Support](https://img.shields.io/pypi/pyversions/cosmicexcuse.svg)](https://pypi.org/project/cosmicexcuse/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Documentation Status](https://readthedocs.org/projects/cosmicexcuse/badge/?version=latest)](https://cosmicexcuse.readthedocs.io/)\n[![Tests](https://github.com/shamspias/cosmicexcuse/actions/workflows/tests.yml/badge.svg)](https://github.com/shamspias/cosmicexcuse/actions/workflows/tests.yml)\n\n\u003cimg src=\"https://raw.githubusercontent.com/shamspias/cosmicexcuse/main/docs/assets/logo.png\" alt=\"CosmicExcuse Logo\" width=\"200\"/\u003e\n\n**Generate quantum-grade excuses for your code failures!** 🐛✨\n\n*\"It's not a bug, it's a quantum feature!\"*\n\n[**Installation**](#-installation) • [**Quick Start**](#-quick-start) • [**Documentation\n**](https://cosmicexcuse.readthedocs.io/) • [**Examples**](#-examples) • [**API Reference**](#-api-reference)\n\n\u003c/div\u003e\n\n---\n\n## 📖 Table of Contents\n\n- [Features](#-features)\n- [Installation](#-installation)\n- [Quick Start](#-quick-start)\n- [Examples](#-examples)\n- [CLI Usage](#-cli-usage)\n- [API Reference](#-api-reference)\n- [Configuration](#️-configuration)\n- [Contributing](#-contributing)\n- [License](#-license)\n\n## ✨ Features\n\n### Core Features\n\n- 🌍 **Multi-language Support** - English and Bengali with easy extensibility\n- 🎯 **Smart Severity Analysis** - Automatically adapts to error severity\n- 🔬 **Technical Jargon Generation** - Markov chain-based technobabble\n- 📊 **Excuse Quality Scoring** - Rate and track the best excuses\n- 🎨 **Multiple Output Formats** - Plain text, Markdown, JSON, Haiku\n- 🏆 **Leaderboard System** - Track and rank excuses\n- 📦 **Zero Dependencies** - Pure Python implementation\n- 🚀 **Fast \u0026 Lightweight** - Instant generation with minimal overhead\n\n### Excuse Categories\n\n- **Quantum** - Quantum mechanics and physics-based excuses\n- **Cosmic** - Space and astronomical phenomena\n- **AI** - Machine learning and artificial intelligence\n- **Technical** - General technical difficulties\n- **Blame** - Redirect responsibility creatively\n\n## 📦 Installation\n\n### From PyPI (Recommended)\n\n```bash\npip install cosmicexcuse\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/shamspias/cosmicexcuse.git\ncd cosmicexcuse\npip install -e .\n```\n\n### Development Installation\n\n```bash\npip install cosmicexcuse[dev]  # Includes testing and linting tools\n```\n\n## 🚀 Quick Start\n\n### Python API\n\n```python\nfrom cosmicexcuse import CosmicExcuse\n\n# Initialize generator\ngenerator = CosmicExcuse()\n\n# Generate an excuse for your error\nexcuse = generator.generate(\"FATAL ERROR: Database connection failed!\")\n\nprint(excuse.text)\n# Output: \"The error was catastrophically caused by quantum entanglement \n#          in the CPU cache, resulting in solar flare interference...\"\n\nprint(excuse.recommendation)\n# Output: \"Try turning it off and on again, but quantumly\"\n```\n\n### One-Liner\n\n```python\nimport cosmicexcuse\n\nprint(cosmicexcuse.generate(\"Segmentation fault\"))\n```\n\n### CLI Usage\n\n```bash\n# Generate a random excuse\ncosmicexcuse\n\n# Generate for specific error\ncosmicexcuse --error \"Failed to compile\"\n\n# Generate haiku\ncosmicexcuse --haiku\n\n# Generate in Bengali\ncosmicexcuse --language bn\n```\n\n## 📚 Examples\n\n### Basic Usage\n\n```python\nfrom cosmicexcuse import CosmicExcuse\n\ngenerator = CosmicExcuse()\n\n# Simple generation\nexcuse = generator.generate()\nprint(f\"Excuse: {excuse.text}\")\nprint(f\"Recommendation: {excuse.recommendation}\")\nprint(f\"Severity: {excuse.severity}\")\nprint(f\"Quality Score: {excuse.quality_score}/100\")\n```\n\n### Category-Specific Excuses\n\n```python\n# Generate quantum-themed excuse\nquantum_excuse = generator.generate(\n    error_message=\"Array index out of bounds\",\n    category=\"quantum\"\n)\n\n# Generate AI-themed excuse\nai_excuse = generator.generate(\n    error_message=\"Model training failed\",\n    category=\"ai\"\n)\n\n# Generate cosmic-themed excuse\ncosmic_excuse = generator.generate(\n    error_message=\"Connection timeout\",\n    category=\"cosmic\"\n)\n```\n\n### Batch Generation\n\n```python\n# Generate multiple excuses\nexcuses = generator.generate_batch(count=5)\n\nfor i, excuse in enumerate(excuses, 1):\n    print(f\"{i}. {excuse.text[:50]}...\")\n    print(f\"   Score: {excuse.quality_score}/100\")\n```\n\n### Haiku Mode\n\n```python\n# Generate poetic excuse\nhaiku = generator.generate_haiku(\"Memory leak detected\")\nprint(haiku)\n\n# Output:\n# Quantum states collapsed\n# The servers cry digital tears\n# Bits flipped in the void\n```\n\n### History and Best Excuses\n\n```python\n# Track history\ngenerator = CosmicExcuse()\n\n# Generate several excuses\nfor i in range(10):\n    generator.generate(f\"Error {i}\")\n\n# Get the best excuse\nbest = generator.get_best_excuse()\nprint(f\"Best excuse (score {best.quality_score}): {best.text}\")\n\n# Export history\nhistory = generator.export_history(format='json')\n```\n\n### Custom Formatting\n\n```python\nfrom cosmicexcuse.formatter import MarkdownFormatter, TwitterFormatter\n\n# Markdown format\nmd_formatter = MarkdownFormatter()\nmarkdown_output = md_formatter.format(excuse.__dict__)\n\n# Twitter-ready format (280 chars)\ntwitter_formatter = TwitterFormatter()\ntweet = twitter_formatter.format({'text': excuse.text})\n```\n\n### Error Handler Integration\n\n```python\nfrom cosmicexcuse import CosmicExcuse\n\ngenerator = CosmicExcuse()\n\n\ndef cosmic_handler(func):\n    \"\"\"Decorator to handle errors with cosmic excuses.\"\"\"\n\n    def wrapper(*args, **kwargs):\n        try:\n            return func(*args, **kwargs)\n        except Exception as e:\n            excuse = generator.generate(str(e))\n            print(f\"Error: {e}\")\n            print(f\"Excuse: {excuse.text}\")\n            print(f\"Fix: {excuse.recommendation}\")\n            raise\n\n    return wrapper\n\n\n@cosmic_handler\ndef risky_function():\n    return 1 / 0  # This will generate an excuse!\n```\n\n## 🎮 CLI Usage\n\n### Basic Commands\n\n```bash\n# Generate random excuse\ncosmicexcuse\n\n# Generate for specific error\ncosmicexcuse --error \"NullPointerException\"\n\n# Generate multiple excuses\ncosmicexcuse --count 5\n\n# Generate in different language\ncosmicexcuse --language bn\n```\n\n### Advanced Options\n\n```bash\n# Generate haiku format\ncosmicexcuse --haiku\n\n# Specify category\ncosmicexcuse --category quantum\n\n# Show quality scores\ncosmicexcuse --show-score\n\n# Set minimum quality\ncosmicexcuse --min-score 80\n\n# Output as JSON\ncosmicexcuse --json\n```\n\n### Examples\n\n```bash\n# Generate high-quality quantum excuse\ncosmicexcuse --category quantum --min-score 90\n\n# Generate Bengali haiku\ncosmicexcuse --language bn --haiku\n\n# Generate 3 excuses with scores in JSON\ncosmicexcuse --count 3 --show-score --json\n```\n\n## 📊 API Reference\n\n### CosmicExcuse Class\n\n```python\nclass CosmicExcuse:\n    def __init__(self, language: str = 'en', data_path: Optional[Path] = None)\n\n        def generate(self, error_message: str = '', context: str = None,\n                     category: str = None) -\u003e Excuse\n\n        def generate_batch(self, count: int = 5) -\u003e List[Excuse]\n\n        def generate_haiku(self, error_message: str = '') -\u003e str\n\n        def get_best_excuse(self) -\u003e Optional[Excuse]\n\n        def clear_history(self) -\u003e None\n\n        def export_history(self, format: str = 'json') -\u003e Union[str, List[Dict]]\n```\n\n### Excuse Object\n\n```python\n@dataclass\nclass Excuse:\n    text: str  # The generated excuse text\n    recommendation: str  # Suggested fix\n    severity: str  # 'mild', 'medium', or 'severe'\n    category: str  # Category used\n    quality_score: int  # 0-100 quality rating\n    quantum_probability: float  # Random quantum factor\n    language: str  # Language code\n    timestamp: float  # Generation time\n    metadata: Dict[str, Any]  # Additional data\n```\n\n### SeverityAnalyzer\n\n```python\nclass SeverityAnalyzer:\n    def analyze(self, error_message: str) -\u003e str\n\n        def get_severity_details(self, error_message: str) -\u003e Dict[str, Any]\n```\n\n## ⚙️ Configuration\n\n### Custom Data Path\n\n```python\nfrom pathlib import Path\nfrom cosmicexcuse import CosmicExcuse\n\n# Use custom excuse data\ncustom_path = Path(\"./my_excuses\")\ngenerator = CosmicExcuse(data_path=custom_path)\n```\n\n### Adding New Languages\n\n1. Create directory: `cosmicexcuse/data/{language_code}/`\n2. Add JSON files for each category\n3. Update `SUPPORTED_LANGUAGES` in `generator.py`\n\n### Extending Categories\n\nCreate a new JSON file in the appropriate language directory:\n\n```json\n{\n  \"category\": \"custom\",\n  \"language\": \"en\",\n  \"version\": \"1.0.0\",\n  \"excuses\": [\n    \"Your custom excuse here\",\n    \"Another creative excuse\"\n  ]\n}\n```\n\n## 🧪 Testing\n\n```bash\n# Run all tests\npytest\n\n# Run with coverage\npytest --cov=cosmicexcuse --cov-report=html\n\n# Run specific test\npytest tests/test_generator.py -v\n\n# Type checking\nmypy cosmicexcuse\n\n# Linting\nflake8 cosmicexcuse tests\nblack cosmicexcuse tests --check\n```\n\n## 📈 Performance\n\n- **Generation Speed**: \u003c 1ms per excuse\n- **Memory Usage**: \u003c 10MB\n- **Startup Time**: \u003c 100ms\n- **Zero Dependencies**: No external packages required\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n### Quick Start for Contributors\n\n```bash\n# Fork and clone the repo\ngit clone https://github.com/YOUR_USERNAME/cosmicexcuse.git\n\n# Install in development mode\npip install -e .[dev]\n\n# Create a branch\ngit checkout -b feature/amazing-feature\n\n# Make changes and test\npytest\nblack cosmicexcuse tests\nflake8 cosmicexcuse tests\n\n# Commit and push\ngit commit -m \"Add amazing feature\"\ngit push origin feature/amazing-feature\n```\n\n## 📜 License\n\nThis project is licensed under the MIT License - see [LICENSE](LICENSE) file.\n\n## 🙏 Acknowledgments\n\n- The cosmic rays that flipped the bits to create this project\n- The quantum entanglement that brought you to this README\n- All developers who've ever needed a good excuse\n\n## ⚠️ Disclaimer\n\nThis tool is for entertainment purposes only. Please do not use these excuses in:\n\n- Production incident reports\n- Performance reviews\n- Court testimony\n- NASA mission control\n\n## 📊 Project Statistics\n\n- 200+ unique quantum excuses\n- 150+ cosmic event scenarios\n- 100+ AI sentience situations\n- 2 supported languages\n- ∞ possible combinations\n\n## 🔗 Links\n\n- [PyPI Package](https://pypi.org/project/cosmicexcuse/)\n- [Documentation](https://cosmicexcuse.readthedocs.io/)\n- [GitHub Repository](https://github.com/shamspias/cosmicexcuse)\n- [Issue Tracker](https://github.com/shamspias/cosmicexcuse/issues)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Built with 💙 and quantum uncertainty by [Shamsuddin Ahmed](https://github.com/shamspias)**\n\n*Remember: With great code comes great need for excuses.*\n\n⭐ Star us on GitHub if this saved your standup meeting!\n\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshamspias%2Fcosmicexcuse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshamspias%2Fcosmicexcuse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshamspias%2Fcosmicexcuse/lists"}