Skip to main content

HaTeMiLe is a library that can convert a HTML code in a HTML code more accessible.

Project description

HaTeMiLe for Python

HaTeMiLe (HTML Accessible) is a library that can convert a HTML code in a HTML code more accessible.

Accessibility solutions

Documentation

To generate the full API documentation of HaTeMiLe of Python:

  1. Install, create and activate a virtualenv;
  2. Install dependencies;
  3. Execute the API docs of sphinx in docs directory;
    sphinx-apidoc -e -f -o _modules/ ../hatemile
    make html
    
  4. Open the docs/_build/html/index.html with an internet browser.

Import the library to your project

To install the HaTeMiLe for Python library, execute these command in terminal:

pip install hatemile

Usage

Import all needed classes:

from hatemile.implementation.assoc import AccessibleAssociationImplementation
from hatemile.implementation.css import AccessibleCSSImplementation
from hatemile.implementation.display import AccessibleDisplayImplementation
from hatemile.implementation.event import AccessibleEventImplementation
from hatemile.implementation.form import AccessibleFormImplementation
from hatemile.implementation.navig import AccessibleNavigationImplementation
from hatemile.util.configure import Configure
from hatemile.util.css.tinycss.tinycssparser import TinyCSSParser
from hatemile.util.html.bs.bshtmldomparser import BeautifulSoupHTMLDOMParser

Instanciate the configuration, the parsers and solution classes and execute them:

configure = Configure()

parser = BeautifulSoupHTMLDOMParser(html_code)
css_parser = TinyCSSParser(parser, current_url)

event = AccessibleEventImplementation(parser)
css = AccessibleCSSImplementation(parser, css_parser, configure)
form = AccessibleFormImplementation(parser)
navigation = AccessibleNavigationImplementation(parser, configure)
association = AccessibleAssociationImplementation(parser)
display = AccessibleDisplayImplementation(parser, configure)

event.make_accessible_all_drag_and_drop_events()
event.make_accessible_all_click_events()
event.make_accessible_all_hover_events()

form.mark_all_required_fields()
form.mark_all_range_fields()
form.mark_all_autocomplete_fields()
form.mark_all_invalid_fields()

navigation.provide_navigation_by_all_headings()
navigation.provide_navigation_by_all_skippers()
navigation.provide_navigation_to_all_long_descriptions()

association.associate_all_data_cells_with_header_cells()
association.associate_all_labels_with_fields()

css.provide_all_speak_properties()

display.display_all_shortcuts()
display.display_all_roles()
display.display_all_cell_headers()
display.display_all_waiaria_states()
display.display_all_links_attributes()
display.display_all_titles()
display.display_all_languages()
display.display_all_alternative_text_images()

navigation.provide_navigation_by_all_skippers()
display.display_all_shortcuts()

print(parser.get_html())

Contributing

If you want contribute with HaTeMiLe for Python, read contributing guidelines.

See also

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

hatemile-2.0.1-py3-none-any.whl (68.2 kB view details)

Uploaded Python 3

File details

Details for the file hatemile-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for hatemile-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f69040882ff9cb766a1984280b983f3e9026465cdb8da678b88dff04129b66c3
MD5 f16732e7d956f322ead83c50b283e4cf
BLAKE2b-256 1b8dd5fc1a2ff1c13cf3e430b7fc240f863f7ea4175b5b2ac556d565243425e4

See more details on using hashes here.

Supported by

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