Skip to main content

faviconer is easy for get favicon package

Project description

[![CircleCI](https://circleci.com/gh/kuniiskywalker/faviconer.svg?style=svg)](https://circleci.com/gh/kuniiskywalker/faviconer)

What is this?

This is a package to get a nice favicon from a website

Installation

pip install faviconer

Usage

Get favicon.ico:

Get /favicon.ico if there is no explicit favicon url specified in the meta tag of the target site

When the favicon url is specified in the meta tag

>>> import faviconer
>>> faviconer.get_by_url("https://example.com/test/?aaa=1")
'https://example.com/image/icon.png'

When there is no specific URL specified in the meta tag

>>> import faviconer
>>> faviconer.get_by_url("https://example.com/test/?aaa=1")
'https://example.com/favicon.ico'

Get favicon.ico by url:

>>> import faviconer
>>> faviconer.get_by_url("https://example.com/")
'https://example.com/favicon.ico'

Get favicon.ico by html:

Analyze the target site html and get favicon.ico if favicon url is specified in meta tag

>>> import faviconer
>>> faviconer.get_by_html('<html><head><link rel="shortcut icon" href="https://cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico"></head><body></body</html>')
'https://cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico'

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 faviconer, version 0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size faviconer-0.1.5-py3-none-any.whl (3.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size faviconer-0.1.5.tar.gz (2.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page