Skip to main content

Python AMP Library

Project description

Python AMP Library

Build Status codecov PyPI version

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>'

Project details


Download files

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

Files for amp-tools, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size amp_tools-0.0.2-py2.py3-none-any.whl (7.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size amp_tools-0.0.2.tar.gz (5.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page