Skip to main content

Asynchronous Python client for the accessibility checker API

Project description

a11y-checker

a11y-checker is an asynchronous Python client for the Accessibility Checker API - a tool for automated accessibility audits based on WCAG 2.1 / 2.2.
It lets you easily scan, re-scan, and analyze websites directly from your Python applications.


Features

  • Fully asynchronous (non-blocking)
  • Multi-language and device scanning
  • Fetch, re-scan, or delete audits

Installation

pip install a11y-checker

Usage Example

import asyncio
from a11y_checker import A11yCheckerClient, Device, Language

async def main():
    async with A11yCheckerClient() as guest:
        # Run a new audit
        audit_request = await guest.scan("https://example.com", lang=Language.EN, device=Device.DESKTOP)
        print(audit_request)

        # Get audit
        audit = await guest.audit(uuid=audit_request['uuid'])
        print(audit)

        # Delete an audit
        await guest.delete_audit(audit['uuid'])

asyncio.run(main())

🔑 Get Your API Key

You can test as a guest, request an API key, or test the service directly on the website:

👉 https://wcag.dock.codes/contact-us/

Enums

Enum Description Example
Language Language for audits Language.EN, Language.PL, Language.DE
Device Device type for scanning Device.DESKTOP, Device.MOBILE, Device.ALL
AuditStatus Filter audits by status AuditStatus.PASSED, AuditStatus.FAILED, AuditStatus.TO_TESTS
Sort Sorting order for results Sort.CREATED_AT_DESC, Sort.LAST_AUDIT_ASC

Available Methods

Method Description
scan(url: str, lang: Language, device: Device, sync: bool, extra_data: bool, unique_key: Optional[str], key: Optional[str]) Run a new accessibility scan for a given URL.
audit(uuid: str, lang: Language, extra_data: bool key: Optional[str]) Get detailed results of a specific audit.
audits(search: str, page: int, per_page: int, sort: Sort, unique_key: Optional[str], key: Optional[str]) Fetch paginated audits with optional filtering and sorting.
rescan(uuid: str, lang: Language, sync: bool, extra_data: bool = False) Trigger a re-scan of an existing audit.
history(uuid: str, page: int, per_page: int, sort: Sort, key: Optional[str]) Fetch paginated audit history with optional filtering and sorting.
delete_audit(uuid: str, key: Optional[str]) Delete an existing audit.
delete_history(uuid: str, key: Optional[str]) Delete audit history.
user(key: Optional[str]) Get current user data.
update_audit_manual(uuid: str, criterion_id: int, status: AuditStatus, device: Device, key: Optional[str]) Updating the status of a single criterion from a manual audit.

Advanced Example: Parallel Audits

import asyncio
from a11y_checker import A11yCheckerClient

async def main():
    async with A11yCheckerClient(api_key="your-api-key") as client:
        results = await asyncio.gather(
            client.audit(uuid="uuid1"),
            client.audit(uuid="uuid2"),
            client.audit(uuid="uuid3"),
        )
        print(results)

asyncio.run(main())

🤝 Contributing Contributions are welcome! If you find a bug or want to improve the library, please open an issue or pull request on 👉 GitHub

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a11y_checker-1.0.4.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a11y_checker-1.0.4-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file a11y_checker-1.0.4.tar.gz.

File metadata

  • Download URL: a11y_checker-1.0.4.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for a11y_checker-1.0.4.tar.gz
Algorithm Hash digest
SHA256 c083f40887b49fff68ee7c0297029b5968c0516756e1ad3e2f5c630e1d41f1de
MD5 e58cfa259db0b5f0e9444cdc063a9ac1
BLAKE2b-256 79309f856d6fd392c389d25d756e4f6d82f45a72a0db8a9bd876f51954bdaee1

See more details on using hashes here.

File details

Details for the file a11y_checker-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: a11y_checker-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for a11y_checker-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 84edab162603d69a6db783ca2a0fb2d12930176d0f49fbee3abf1d9974c66eb6
MD5 588d250bfe12d67e7e2bee490bc795dc
BLAKE2b-256 d1c44701f058fb3211c4eb4d482d79369fb4b3caffcd52638429e3076ff84e3a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page