{"id":50201106,"url":"https://github.com/automated-a11y/python-a11y-playwright","last_synced_at":"2026-05-25T22:01:16.355Z","repository":{"id":65508470,"uuid":"591067086","full_name":"automated-a11y/python-a11y-playwright","owner":"automated-a11y","description":"Accessibility Automation Example for Web Apps with Python and Playwright","archived":false,"fork":false,"pushed_at":"2023-01-30T21:41:43.000Z","size":1098,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-23T03:55:56.394Z","etag":null,"topics":["a11y","a11y-testing","accessibility","accessibility-automation","accessibility-testing","axe","htmlcodesniffer","htmlcs","playwright","playwright-python","python"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/automated-a11y.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-19T21:09:56.000Z","updated_at":"2025-08-06T21:40:00.000Z","dependencies_parsed_at":"2023-02-14T19:16:28.130Z","dependency_job_id":null,"html_url":"https://github.com/automated-a11y/python-a11y-playwright","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/automated-a11y/python-a11y-playwright","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/automated-a11y%2Fpython-a11y-playwright","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/automated-a11y%2Fpython-a11y-playwright/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/automated-a11y%2Fpython-a11y-playwright/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/automated-a11y%2Fpython-a11y-playwright/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/automated-a11y","download_url":"https://codeload.github.com/automated-a11y/python-a11y-playwright/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/automated-a11y%2Fpython-a11y-playwright/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33494784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"ssl_error","status_checked_at":"2026-05-25T14:31:02.878Z","response_time":57,"last_error":"SSL_read: 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":["a11y","a11y-testing","accessibility","accessibility-automation","accessibility-testing","axe","htmlcodesniffer","htmlcs","playwright","playwright-python","python"],"created_at":"2026-05-25T22:00:55.083Z","updated_at":"2026-05-25T22:01:16.346Z","avatar_url":"https://github.com/automated-a11y.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Accessibility Automation for Web Apps with Python and [Playwright](https://playwright.dev/).\n\n### This project uses [HTML CodeSniffer](https://squizlabs.github.io/HTML_CodeSniffer/) and [Deque Axe](https://www.deque.com/)\n\n**HTML CodeSniffer** : checks HTML source code and detects any Accessibility violations. Comes with standards that cover\nthe three (A, AA \u0026 AAA) conformance levels of the W3C's Web Content Accessibility Guidelines (WCAG) 2.1 and the U.S.\nSection 508 legislation.\n\n**Deque Axe** : World’s leading digital accessibility toolkit. Powerful and accurate accessibility toolkit can get you\nto 80% issue coverage, or more, during development.\n\n[![Python badge](https://img.shields.io/badge/python-3.10-green.svg)](https://www.python.org/downloads/)\n[![PyPI version](https://img.shields.io/pypi/v/python-a11y-playwright)](https://pypi.org/project/python-a11y-playwright/)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/52674c845fa54bc5afafd9b4ce960503)](https://www.codacy.com/gh/automated-a11y/python-a11y-playwright/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=automated-a11y/python-a11y-playwright\u0026amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/52674c845fa54bc5afafd9b4ce960503)](https://www.codacy.com/gh/automated-a11y/python-a11y-playwright/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=automated-a11y/python-a11y-playwright\u0026utm_campaign=Badge_Coverage)\n[![License badge](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Contributer badge](https://img.shields.io/github/contributors/automated-a11y/java-a11y-playwright.svg)](https://github.com/automated-a11y/java-a11y-playwright/graphs/contributors)\n\n### Features\n\n1. Simple \u0026 Easy to use\n2. No need of prior knowledge on Accessibility\n3. Works with Python [Playwright](https://playwright.dev/)\n4. Rich Reporting\n5. Open source\n\n### Installation\n```\npip install python-a11y-playwright\n```\n### Getting Started\n\n#### Using HTML CodeSniffer\n\nBelow is the example usage using HTML CodeSniffer.\n\n```python\nfrom pathlib import Path\n\nfrom automateda11y.pw.settings import Settings\nfrom playwright.sync_api import sync_playwright\nfrom automateda11y.pw.htmlcsrunner import HtmlCsRunner\n\n\ndef json_reports_dir():\n    return Path(__file__).parent.parent.__str__()\n\n\nwith sync_playwright() as p:\n    Settings.report_dir = json_reports_dir() + '/reports'\n    browser = p.chromium.launch(headless=False)\n    page = browser.new_page()\n    page.goto(\"http://playwright.dev\")\n    data = HtmlCsRunner(page).execute()\n    browser.close()\n```\n\n#### Using Deque Axe\n\nBelow is the example usage using Deque Axe.\n\n```python\nfrom pathlib import Path\n\nfrom automateda11y.pw.settings import Settings\nfrom playwright.sync_api import sync_playwright\nfrom automateda11y.pw.axerunner import AxeRunner\n\n\ndef json_reports_dir():\n    return Path(__file__).parent.parent.__str__()\n\n\nwith sync_playwright() as p:\n    Settings.report_dir = json_reports_dir() + '/reports'\n    browser = p.chromium.launch(headless=False)\n    page = browser.new_page()\n    page.goto(\"http://playwright.dev\")\n    data = AxeRunner(page).execute()\n    browser.close()\n```\nIt is mandated to provide path to generate JSON reports as shown in both the above examples. Once the tests been executed, JSON reports will be generated in the provided directory\n\n### HTML Reports\nTo generate HTML reports from the JSON reports, it is required to download and configure the Java based command line [utility](https://github.com/automated-a11y/automated-a11y-reporter)\n\n#### Pre-requisites\n1. JDK 1.8 or above\n\n#### Configuration\n1. Download the latest version zip archive from [releases](https://github.com/automated-a11y/automated-a11y-reporter/releases)\n2. Unpack the archive to **a11y-reports** directory. a11y-reports directory contains `a11y-report`, `a11y-report.bat` and `a11y.jar`\n3. Add **a11y-reports** directory to system PATH\n4. Execute `a11y-report --version` in terminal/cmd to make sure that a11y-report is configured\n\n#### Usage\n\u003e `a11y-report -j=\u003cjsonDir\u003e -e=\u003cengine\u003e -o=\u003coutputDir\u003e`\n\n* **jsonDir** - JSON reports path generated by the libraries in the Organisation [automated-a11y](https://github.com/automated-a11y)\n* **engine** - Accessibility engine `axe or htmlcs`\n* **outputDir**(Optional) - Output directory to save the HTML report. Generates in CWD if not provided\n\n#### HTML CodeSniffer Report Generation\n\u003e `a11y-report -j=\u003cjsonDir\u003e -e=htmlcs -o=\u003coutputDir\u003e`\n\nHTML Reports will be generated in `\u003coutputDir\u003e` folder.\nBelow are the report screenshots\n\nConsolidated Report\n\n![Index](/readme/htmlcs_index.png)\n\nPage Report\n\n![Page](/readme/htmlcs_page.png)\n\n#### Axe Report Generation\n\u003e `a11y-report -j=\u003cjsonDir\u003e -e=axe -o=\u003coutputDir\u003e`\n\nHTML Reports will be generated in `\u003coutputDir\u003e` folder.\n\n#### Python snippet to generate HTML reports*\n\u003e*This snippet works only if the above-mentioned command line utility is configured.\n```python\nimport subprocess\n\n\nclass A11yReport:\n    def __init__(self, json_dir, engine, output_dir):\n        self.json_dir = json_dir\n        self.engine = engine\n        self.output_dir = output_dir\n\n    def generate_html_report(self):\n        command = f\"a11y-report -j={self.json_dir} -e={self.engine} -o={self.output_dir}\"\n        result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, encoding=\"utf-8\")\n        return result.stdout, result.stderr\n\n```\nIn the tear down method, after executing all tests, call the `generate_html_report` to generate HTML reports\n\n```python\na11y_report = A11yReport(json_dir, \"axe/htmlcs\", html_dir)\nstdout, stderr = a11y_report.generate_html_report()\n\nprint(\"Stdout:\")\nprint(stdout)\nprint(\"Stderr:\")\nprint(stderr)\n```\n\nHere is the example project: https://github.com/automated-a11y/python-a11y-playwright-example for your reference\n\nBelow are the report screenshots\n\nConsolidated Report\n\n![Index](/readme/axe_index.png)\n\nPage Report\n\n![Page](/readme/axe_page.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautomated-a11y%2Fpython-a11y-playwright","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautomated-a11y%2Fpython-a11y-playwright","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautomated-a11y%2Fpython-a11y-playwright/lists"}