Metadata-Version: 2.1
Name: hatemile
Version: 2.0.1
Summary: HaTeMiLe is a library that can convert a HTML code in a HTML code more accessible.
Home-page: https://github.com/hatemile/hatemile-for-python
Author: Carlson Santana Cruz
License: Apache2
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Natural Language :: English
Classifier: Topic :: Software Development :: Libraries
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: beautifulsoup4 (>=4.6.0)
Requires-Dist: certifi (>=2018.4.16)
Requires-Dist: chardet (>=3.0.4)
Requires-Dist: idna (>=2.6)
Requires-Dist: requests (>=2.18.4)
Requires-Dist: tinycss (>=0.4)
Requires-Dist: urllib3 (>=1.22)
Provides-Extra: dev
Requires-Dist: alabaster (>=0.7.10); extra == 'dev'
Requires-Dist: astroid (>=1.6.5); extra == 'dev'
Requires-Dist: atomicwrites (>=1.1.5); extra == 'dev'
Requires-Dist: attrs (>=18.1.0); extra == 'dev'
Requires-Dist: Babel (>=2.6.0); extra == 'dev'
Requires-Dist: docutils (>=0.14); extra == 'dev'
Requires-Dist: imagesize (>=1.0.0); extra == 'dev'
Requires-Dist: isort (>=4.3.4); extra == 'dev'
Requires-Dist: Jinja2 (>=2.10); extra == 'dev'
Requires-Dist: lazy-object-proxy (>=1.3.1); extra == 'dev'
Requires-Dist: MarkupSafe (>=1.0); extra == 'dev'
Requires-Dist: mccabe (>=0.6.1); extra == 'dev'
Requires-Dist: more-itertools (>=4.2.0); extra == 'dev'
Requires-Dist: packaging (>=17.1); extra == 'dev'
Requires-Dist: pluggy (>=0.6.0); extra == 'dev'
Requires-Dist: py (>=1.5.4); extra == 'dev'
Requires-Dist: pycodestyle (>=2.4.0); extra == 'dev'
Requires-Dist: Pygments (>=2.2.0); extra == 'dev'
Requires-Dist: pylint (>=1.9.2); extra == 'dev'
Requires-Dist: pyparsing (>=2.2.0); extra == 'dev'
Requires-Dist: pytest (>=3.6.2); extra == 'dev'
Requires-Dist: pytz (>=2018.4); extra == 'dev'
Requires-Dist: six (>=1.11.0); extra == 'dev'
Requires-Dist: snowballstemmer (>=1.2.1); extra == 'dev'
Requires-Dist: Sphinx (>=1.7.5); extra == 'dev'
Requires-Dist: sphinxcontrib-websupport (>=1.1.0); extra == 'dev'
Requires-Dist: wrapt (>=1.10.11); extra == 'dev'

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](https://github.com/hatemile/hatemile-for-python/wiki/Associate-HTML-elements);
* [Provide a polyfill to CSS Speech and CSS Aural properties](https://github.com/hatemile/hatemile-for-python/wiki/Provide-a-polyfill-to-CSS-Speech-and-CSS-Aural-properties);
* [Display inacessible informations of page](https://github.com/hatemile/hatemile-for-python/wiki/Display-inacessible-informations-of-page);
* [Enable all functionality of page available from a keyboard](https://github.com/hatemile/hatemile-for-python/wiki/Enable-all-functionality-of-page-available-from-a-keyboard);
* [Improve the acessibility of forms](https://github.com/hatemile/hatemile-for-python/wiki/Improve-the-acessibility-of-forms);
* [Provide accessibility resources to navigate](https://github.com/hatemile/hatemile-for-python/wiki/Provide-accessibility-resources-to-navigate).

## Documentation

To generate the full API documentation of HaTeMiLe of Python:

1. [Install, create and activate a virtualenv](https://packaging.python.org/guides/installing-using-pip-and-virtualenv/);
2. [Install dependencies](https://packaging.python.org/guides/installing-using-pip-and-virtualenv/#using-requirements-files);
3. [Execute the API docs of sphinx in `docs` directory](https://samnicholls.net/2016/06/15/how-to-sphinx-readthedocs/);
    ```bash
    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:

```bash
pip install hatemile
```

## Usage

Import all needed classes:

```python
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:

```python    
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](https://github.com/hatemile/hatemile-for-python/blob/master/CONTRIBUTING.md).

## See also
* [HaTeMiLe for CSS](https://github.com/hatemile/hatemile-for-css)
* [HaTeMiLe for JavaScript](https://github.com/hatemile/hatemile-for-javascript)
* [HaTeMiLe for Java](https://github.com/hatemile/hatemile-for-java)
* [HaTeMiLe for PHP](https://github.com/hatemile/hatemile-for-php)
* [HaTeMiLe for Ruby](https://github.com/hatemile/hatemile-for-ruby)


