Polly - rel-alternate-hreflang parser and validator
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
polly
.gitignore
CONTRIBUTING
LICENSE
MANIFEST
NOTICE
README.md
requirements.txt
setup.cfg
setup.py

README.md

Introduction

polly is a library to help you parse and check rel-alternate-hreflang annotations on a page.

Using polly you can fetch a page and quickly access information about how many rel-alternate-hreflang entries are on a page, and which countries and languages they cover:

my_page = PollyPage(initial_url)
print my_page.hreflang_values
print my_page.languages
print my_page.regions

You can also check various aspects of a page, see whether the pages it includes in its rel-alternate-hreflang entries point back, or whether there are entries that do not see retrievable (due to 404 or 500 etc. errors):

print my_page.is_default
print my_page.no_return_tag_pages()
print my_page.non_retrievable_pages()

Using polly

Simply install it with pip:

pip install polly

Included with polly is a small script for checking a URL:

python hreflang-check.py  "https://www.facebook.com/"

To Do

Why Polly?

Polyglot. Get it?!

Contributing

See CONTRIBUTING file.

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License

See LICENSE file.