Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 1.04 KB

README.md

File metadata and controls

33 lines (22 loc) · 1.04 KB

Python AMP Library

Build Status codecov PyPI version made-with-python

This library contains class what converts html to AMP.

Work in progress

Installation

pip install amp_tools

Usage example

from amp_tools import TransformHtmlToAmp


html_elements = '<span class="test-class">' \
                    '<form class="form-test"></form>' \ 
                    '<img src="media/test.png" width="300" height="220">' \
                '</span>'
        
valid_amp = TransformHtmlToAmp(html_elements)()

# Return 
b'<div class="amp-text"><amp-img src="media/test.png" width="300" height="220" layout="responsive"></amp-img></div>'