pyfavicon
Async favicon fetcher
Requirements
Python 3.7aiohttpbeautifulsoup4Pillow
How to use
from pyfavicon import Favicon
import asyncio
from pathlib import Path
async def download_favicon():
favicon_manager = Favicon(download_dir=Path('.'),
headers={'DNT': '1'})
icons = await favicon_manager.from_url('https://gitlab.com')
# icons = await favicon_manager.from_file('my_html_file.html')
# icons = await avicon_manager.from_html('<link rel="icon" href="favicon.png">')
for icon in icons:
# We use PIL to get the exact size of images.
print("Favicon from : {}".format(icon.link))
print("Favicon export name : {}".format(icon.path))
print("Favicon size : {}".format(icon.size))
print("Favicon format: {}".format(icon.extension))
# Select the largest icon
largest_icon = icons.get_largest()
await largest_icon.save()
asyncio.run(download_favicon())
Examples
You can find a bunch of usage examples here:
Metadata
Release files for pyfavicon 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyfavicon-0.1.1.tar.gz | 4.7 kB | Without provenance | Details for pyfavicon-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyfavicon-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pyfavicon-0.1.1-py3-none-any.whl |
Total release size: 10.4 kB
Release files / pyfavicon-0.1.1.tar.gz
| Download URL | pyfavicon-0.1.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fdd5a222f08488824877d8a00a272657c4e66bbe115520d1d68e6d9892ba8e97
|
|
BLAKE2b-256 checksum How to use checksums |
df625e6731cd9477096152180d826aedfa63f470b3b29c1b3b489f3d914725aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Release files / pyfavicon-0.1.1-py3-none-any.whl
| Download URL | pyfavicon-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00035059ff0734347708a3aebfe15293bbb799369b0bc1dbe7219c0460e6ac97
|
|
BLAKE2b-256 checksum How to use checksums |
b4971139068b231138884f1529a11b5c2188bdd0e8f549c4834bfc671fe32ffd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Security for pyfavicon 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.