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
- Associate HTML elements;
- Provide a polyfill to CSS Speech and CSS Aural properties;
- Display inacessible informations of page;
- Enable all functionality of page available from a keyboard;
- Improve the acessibility of forms;
- Provide accessibility resources to navigate.
Documentation
To generate the full API documentation of HaTeMiLe of Python:
- Install, create and activate a virtualenv;
- Install dependencies;
- Execute the API docs of sphinx in
docs
directory;sphinx-apidoc -e -f -o _modules/ ../hatemile make html
- 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
Release history Release notifications | RSS feed
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)
File details
Details for the file hatemile-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: hatemile-2.0.1-py3-none-any.whl
- Upload date:
- Size: 68.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f69040882ff9cb766a1984280b983f3e9026465cdb8da678b88dff04129b66c3 |
|
MD5 | f16732e7d956f322ead83c50b283e4cf |
|
BLAKE2b-256 | 1b8dd5fc1a2ff1c13cf3e430b7fc240f863f7ea4175b5b2ac556d565243425e4 |