You supply the URL, pyfav will supply the favicon
Project description
pyfav is a simple Python library that helps you get a favicon for a supplied URL.
Favicons can be annoying to track down because they’re commonly located in a handful of different places. pyfav removes the annoyance by handling the details for you – you supply a URL and pyfav will give you the favicon.
Exchange a URL for a favicon on disk
The simplest way to get started is to use the download_favicon function,
from pyfav import download_favicon
favicon_saved_at = download_favicon('https://www.python.org/')
You should now see the favicon in your /tmp directory. If you want to control where the favicon gets written to disk,
from pyfav import download_favicon
mkdir /tmp/favicon-downloads
favicon_saved_at = download_favicon('https://www.python.org/', \
file_prefix='python.org-', target_dir='/tmp/favicon-downloads')
Get the location
If you’d prefer to handle the writing piece, use the get_favicon_url function,
from pyfav import download_favicon
favicon_url = get_favicon_url('https://www.python.org/')
Install
The easiest to get pyfav is through PIP
pip install pyfav
License
pyfav is open source and freely avaiable under the MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pyfav-0.1.tar.gz.
File metadata
- Download URL: pyfav-0.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
223ffbff4d147e7dd8241e8201d73bce41be5a5d5d5de0f7967500528814c17b
|
|
| MD5 |
e330b111d64e820c019d406128ab7695
|
|
| BLAKE2b-256 |
fea2a0281199dedf1912de75a9a631b5855ae6e86ad6f67030fad3c9e4e29804
|