Skip to main content

PDF Accessibility Validator

Project description

avalpdf - PDF Accessibility Validator

A command-line tool for validating PDF accessibility, analyzing document structure, and generating detailed reports.

Features

Document structure analysis and support
  • Document structure analysis
  • Support for both local and remote PDF files
Document tags and metadata validation
  • Document tagging status
  • Title presence
  • Language declaration (Italian)
Heading hierarchy validation
  • H1 presence
  • Correct heading levels sequence
Figure alt text validation
  • Missing alternative text detection
  • Complex or problematic alt text patterns
Tables structure validation
  • Header presence and proper structure
  • Empty cells detection
  • Duplicate headers check
  • Multiple header rows warning
  • Empty tables detection
Lists structure validation
  • Proper list tagging
  • Detection of untagged lists (consecutive paragraphs with bullets/numbers)
  • Misused list types (numbered items in unordered lists)
  • List hierarchy consistency
Links validation
  • Detection of non-descriptive links
  • Raw URL text warnings
  • Email and institutional domain exceptions
Formatting issues detection
  • Excessive underscores (used for underlining)
  • Spaced capital letters (like "T E S T")
  • Extra spaces used for layout (3+ consecutive spaces)
Empty elements detection
  • Empty paragraphs
  • Whitespace-only elements
  • Empty headings
  • Empty spans
  • Empty table cells
Output formats
  • Detailed JSON structure
  • Simplified JSON
  • Accessibility validation report
  • Console reports with color-coded structure visualization
Scoring and reporting
  • Weighted scoring system based on accessibility criteria
  • Detailed issue categorization (issues, warnings, successes)

Installation

Using pip

pip install avalpdf

Or uv

uv tool install avalpdf

Updates

Using pip

pip install avalpdf --upgrade

Or uv

uv tool install avalpdf --upgrade

Usage

After installation, you can run avalpdf from any directory.

Quick start

Simply run

avalpdf thesis.pdf

or

avalpdf https://example.com/document.pdf

to get a report like this

accessibility report

and a preview of the structure

pdf structure preview

Details

# Basic validation with console output
avalpdf document.pdf

# Complete analysis with all outputs
avalpdf document.pdf --full --simple --report

# Save reports to specific directory
avalpdf document.pdf -o /path/to/output --report --simple

# Show document structure only
avalpdf document.pdf --show-structure

# Display version information
avalpdf --version

Command Line Options

  • --full: Save full JSON structure
  • --simple: Save simplified JSON structure
  • --report: Save validation report
  • --output-dir, -o: Specify output directory
  • --show-structure: Display document structure
  • --show-validation: Display validation results
  • --quiet, -q: Suppress console output
  • --rich: Use enhanced visual formatting for document structure
  • --tree: Use tree view instead of panel view with Rich formatting
  • --version, -v: Display the version number and exit

Examples

  1. Quick accessibility check:
avalpdf thesis.pdf
  1. Generate all reports:
avalpdf report.pdf --full --simple --report -o ./analysis
  1. Silent operation with report generation:
avalpdf document.pdf --report -q
  1. Analyze multiple files:
for file in *.pdf; do avalpdf "$file" --report --quiet; done

Validation Output

The tool provides three types of findings:

  • ✅ Successes: Correctly implemented accessibility features
  • ⚠️ Warnings: Potential issues that need attention
  • ❌ Issues: Problems that must be fixed

Report Format

{
  "validation_results": {
    "issues": ["..."],
    "warnings": ["..."],
    "successes": ["..."]
  }
}

License

MIT License

Support

For issues or suggestions:

  • Open an issue on GitHub
  • Provide the PDF file (if possible) and the complete error message
  • Include the command you used and your operating system information

Local development

uv venv .test
source .test/bin/activate
uv pip install -e . --upgrade

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

avalpdf-0.1.5.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

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

avalpdf-0.1.5-py3-none-any.whl (36.5 kB view details)

Uploaded Python 3

File details

Details for the file avalpdf-0.1.5.tar.gz.

File metadata

  • Download URL: avalpdf-0.1.5.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for avalpdf-0.1.5.tar.gz
Algorithm Hash digest
SHA256 dca23461ffdb7bb862fd333d6116c95504992f25a90ad7f3d4e0d561874c19fa
MD5 5d1eb99628f5c5331139725613bb248b
BLAKE2b-256 86450c596376bcfd964dc510011c296c64e659e252649d6d1eba9d5eb71cb5bf

See more details on using hashes here.

File details

Details for the file avalpdf-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: avalpdf-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 36.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for avalpdf-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b89cc9cd46ff75ea8fd2a004e39a5c0d690b7b8ca16b5f11112600d4eb3354b1
MD5 5fa4a16b35d28c6d47336c000747181d
BLAKE2b-256 6ee25596689cca2bc10de79de56d1cbcbfa38274b854ee65b7666c19a74eba4b

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