Find a website's favicon
Project description
favicon is a Python library to find a website’s favicon.
Usage
Get all icons:
>>> import favicon
>>> icons = favicon.get('https://www.python.org/')
Icon(url='https://www.python.org/static/apple-touch-icon-144x144-precomposed.png', width=144, height=144, format='png')
Icon(url='https://www.python.org/static/apple-touch-icon-114x114-precomposed.png', width=114, height=114, format='png')
Icon(url='https://www.python.org/static/apple-touch-icon-72x72-precomposed.png', width=72, height=72, format='png')
Icon(url='https://www.python.org/static/apple-touch-icon-precomposed.png', width=0, height=0, format='png')
Icon(url='https://www.python.org/static/favicon.ico', width=0, height=0, format='ico')
Download largest icon:
import requests
import favicon
icons = favicon.get('https://www.python.org/')
icon = icons[0]
response = requests.get(icon.url, stream=True)
with open('/tmp/python-favicon.{}'.format(icon.format), 'wb') as image:
for chunk in response.iter_content(1024):
image.write(chunk)
# /tmp/python-favicon.png
Installation
pip install favicon
Requirements
Inspiration
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
favicon-0.4.0.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for favicon-0.4.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4463013f167227e50cc3a918118ef26e2bf899909effd943f649b347e868385 |
|
MD5 | 527d59f2950f086a7c3b925385fa60f6 |
|
BLAKE2b-256 | b270df3bb9122bb1324f7d02f96e6287d1fcfc7ad9be0ed03c2ae311b9c928ae |