{"id":31250486,"url":"https://github.com/qed42/ai-accessibility-checker","last_synced_at":"2026-05-06T03:33:16.895Z","repository":{"id":309935897,"uuid":"1037962511","full_name":"qed42/ai-accessibility-checker","owner":"qed42","description":"AI Accessibility Checker is a Python CLI and GitHub Action that scans frontend code for WCAG compliance (2.0–2.2, A/AA/AAA). It uses OpenAI to detect issues and provide clear, AI-driven fix suggestions for HTML, CSS, JSX, and more.","archived":false,"fork":false,"pushed_at":"2025-12-10T13:04:00.000Z","size":320,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-10T13:16:03.637Z","etag":null,"topics":["accessibility","accessibility-checker","accessibility-testing","ai-accessibility-checker","ai-powered","automated-testing","compliance","frontend","html-css","openai","python","scss","tailwind","tool","wcag"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qed42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-14T11:55:06.000Z","updated_at":"2025-12-10T13:04:04.000Z","dependencies_parsed_at":"2025-12-10T12:05:32.612Z","dependency_job_id":null,"html_url":"https://github.com/qed42/ai-accessibility-checker","commit_stats":null,"previous_names":["kiran-kadam911/ai-accessibility-checker","qed42/ai-accessibility-checker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qed42/ai-accessibility-checker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qed42%2Fai-accessibility-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qed42%2Fai-accessibility-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qed42%2Fai-accessibility-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qed42%2Fai-accessibility-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qed42","download_url":"https://codeload.github.com/qed42/ai-accessibility-checker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qed42%2Fai-accessibility-checker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32677928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["accessibility","accessibility-checker","accessibility-testing","ai-accessibility-checker","ai-powered","automated-testing","compliance","frontend","html-css","openai","python","scss","tailwind","tool","wcag"],"created_at":"2025-09-23T05:20:15.602Z","updated_at":"2026-05-06T03:33:16.856Z","avatar_url":"https://github.com/qed42.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ♿ AI Accessibility Checker\nA smart Python CLI tool to scan your project’s frontend code for WCAG compliance issues using OpenAI AI analysis.\n\n## Features\n- Supports WCAG Levels: A, AA, AAA\n- Supports WCAG Versions: 2.0, 2.1, 2.2\n- Skips unnecessary folders \u0026 files (node_modules, .git, __pycache__, etc.)\n- AI-powered suggestions for each detected issue\n- Output in table, list or pdf format\n- Works as standalone CLI or pre-commit hook\n\n## Detects accessibility problems like:\n- ✅ Missing alt attributes\n- 🎨 Low contrast text\n- ⌨️ Keyboard navigation issues\n- 📜 Improper semantic markup\n- 🖼️ ARIA misusage\n- 🧠 AI-powered suggestions to fix detected issues\n\n## How It Works\n\n- Reads files and adds line numbers\n- Sends file contents to OpenAI with WCAG context\n- AI detects violations and returns JSON\n- Script formats and displays results\n\n## ⚠️ Data Privacy \u0026 Compliance Notice\n\nThis tool sends code snippets from your project to the OpenAI API for analysis.\nBefore using it, you are responsible for ensuring your project and organization allow sharing code with third-party services.\n**DO NOT USE** this tool on proprietary or confidential code unless you have permission.\n\n## Prerequisites\nBefore using this tool, make sure you have the following installed:\n1. **Python 3.9+**\n    \n    Mac: \n\n    Python 3 is usually preinstalled. Check with:\n\n    ```bash\n    python3 --version\n    ```\n\n    If missing, install via Python.org or Homebrew:\n\n    ```bash\n    brew install python\n    ```\n\n    Windows:\n\n    Download from Python.org\n    When installing, make sure to check the box \"Add Python to PATH\".\n    Verify:\n\n    ```bash\n    python3 --version\n    ```\n\n    Linux:\n\n    ```bash\n    sudo apt update \u0026\u0026 sudo apt install python3 python3-pip -y\n    ```\n\n2. **Pip (Python package manager)**\n\n   ```bash\n    pip --version\n    ```\n\n    If missing:\n    ```bash\n    python3 -m ensurepip --upgrade\n    ```\n\n3. **Virtual Environment (recommended)**\n\n    This avoids dependency conflicts.\n\n    ```bash\n    python3 -m venv venv\n    source venv/bin/activate   # Mac/Linux\n    venv\\Scripts\\activate      # Windows\n    ```\n\n## Installation\n\n1️⃣ Clone / Copy this script into your project\n\n```bash\ngit clone https://github.com/kiran-kadam911/ai-accessibility-checker.git\ncd ai-accessibility-checker\n```\n\n2️⃣ Install dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n📄 requirements.txt\n\n```bash\npython-dotenv\ntabulate\nopenai\u003e=1.0.0\nreportlab\n```\n\n## Usage\n\n### Standalone CLI\n\n#### Setup OpenAI API Key\nYou can get your key from [https://platform.openai.com/account/api-keys](https://platform.openai.com/account/api-keys). (for AI suggestions - Use Paid API plan)\n\nTo use AI-powered features, you need to provide your OpenAI API key.\n    \n    bash -c 'read -p \"Enter your OpenAI API Key: \" key \u0026\u0026 echo \"OPENAI_API_KEY=$key\" \u003e .env'\n\nThis will generate a .env file in your project root like:\n\n    OPENAI_API_KEY=sk-xxxxxxx\n\nOnce API key set then,\n\n**Run**\n\n```bash\npython ai_accessibility_checker.py\n```\n\nYou will be prompted to:\n\n```bash\n👋 Welcome to AI Accessibility Checker\n\n🧩 Which WCAG accessibility level do you want to check? (A / AA / AAA):\n📘 Which WCAG version do you want to check? (2.0 / 2.1 / 2.2): \n📊 How would you like results? (table / list / pdf): \n📂 Enter the directory path to scan the files (leave blank for current directory): \n```\n\n**Example Output (Table)**\n| #  | Issue Title           | Type      | Severity | Line(s)      | Description | Suggestion |\n|----|-----------------------|-----------|----------|--------------|-------------|------------|\n| 1  | Low contrast for text | Contrast  | High     | 25, 29, 231, 233 | Text has low contrast due to faint opacity, making it hard for visually impaired users. | Increase opacity to ≥0.5 to meet contrast ratio requirements. |\n\n**Example Output (List)**\n\n**Missing Alt Text on Image** [Alt Text] _(Severity: High)_\n   - **Lines:** 15  \n   - **Description:** `\u003cimg\u003e` lacks `alt` attribute for screen readers.  \n   - **Suggestion:** Add descriptive `alt` text to all `\u003cimg\u003e` elements.\n\n**Example Output (PDF)**\n![PDF Output Example](images/pdf_report.png)\n\n#### checker.config.json\n\nThe checker.config.json file allows you to customize how the AI Accessibility Checker scans your project.\n\n**Configuration options:**\n- **SUPPORTED_EXTENSIONS** – List of file types the checker will scan (e.g., .html, .twig, .css, .jsx).\n- **EXCLUDED_DIRS** – Directories to skip during scanning (e.g., node_modules, build, .git).\n- **EXCLUDED_PATTERNS** – File name patterns to ignore (e.g., Storybook files like .stories.jsx).\n- **MODEL** – Defines which AI model to use for accessibility analysis.\n\nThis configuration helps tailor the scan to your project’s structure, ensuring that only relevant files are checked while ignoring unnecessary or temporary files.\n\n### Usage as a GitHub Action\nYou can use this tool directly in your GitHub workflows without needing to install anything locally.\n\n#### Save API Key as a GitHub Secret\n- Go to your repository → Settings → Secrets and variables → Actions → New repository secret.\n- Name it: OPENAI_API_KEY\n- Paste your actual key as the value.\n\n```bash\nname: AI Accessibility Checker\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\njobs:\n  run-checker:\n    runs-on: ubuntu-latest\n    steps:\n      # Step 1: Checkout repository\n      - name: Checkout code\n        uses: actions/checkout@v4\n\n      # Step 2: Set up Python\n      - name: Set up Python\n        uses: actions/setup-python@v5\n        with:\n          python-version: '3.10'\n\n      # Step 3: Install dependencies\n      - name: Install dependencies\n        run: |\n          pip install --upgrade pip\n          pip install -r requirements.txt || pip install openai python-dotenv tabulate\n\n      # Step 4: Set environment variables\n      - name: Set environment variables\n        run: |\n          echo \"OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}\" \u003e\u003e $GITHUB_ENV\n          echo \"AI_CHECKER_ACKNOWLEDGED=true\" \u003e\u003e $GITHUB_ENV\n\n      # Step 5: Run Accessibility Checker\n      - name: Run AI Accessibility Checker\n        run: python ai_accessibility_checker.py --level A --version 2.0 --format table --dir ./themes/custom/my_theme\n```\n## Demo\n[Demo Video](https://www.linkedin.com/posts/kiran-kadam-96041b63_a11y-accessibility-wcag-activity-7404507268437692416-Asx7?utm_source=share\u0026utm_medium=member_desktop\u0026rcm=ACoAAA1pAJgBv0ZOhUrgPQBBHvmEJ2Y0bAET9p0)\n\n## License\nThis project is licensed under the MIT License. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqed42%2Fai-accessibility-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqed42%2Fai-accessibility-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqed42%2Fai-accessibility-checker/lists"}