Skip to main content

pyfavicon

Build Status Coverage Status https://pypi.org/project/pyfavicon/ https://pypi.org/project/pyfavicon/ https://bilelmoussaoui.github.io/pyfavicon/

Async favicon fetcher

Requirements

  • Python 3.7
  • aiohttp
  • beautifulsoup4
  • Pillow

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.
        icon_size = await icon.size
        print("Favicon from : {}".format(icon.link))
        print("Favicon export name : {}".format(icon.path))
        print("Favicon size : {}".format(icon_size))
    # Select the largest icon
    largest_icon = await 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

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfavicon 0.1
File Size Uploaded Provenance Actions
pyfavicon-0.1.tar.gz 4.6 kB Without provenance Details for pyfavicon-0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyfavicon 0.1
File Interpreter ABI Platform Actions
pyfavicon-0.1-py3-none-any.whl Python 3 none any Details for pyfavicon-0.1-py3-none-any.whl

Total release size: 10.2 kB

Release files / pyfavicon-0.1.tar.gz

Download URL pyfavicon-0.1.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d9d9c5e72d793d69e9b4a71929525d5de7c9b84a4e0ad6679cc6d05dfc55e3a6
BLAKE2b-256 checksum
How to use checksums
50864d14584b777d21d0692b71d5acc9614f3c1b68b0735e95a8fb029e0012bc
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-py3-none-any.whl

Download URL pyfavicon-0.1-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
086f86a954ed0fb612080f15e296fbc60e85a7752e0622d078db6141c80a64a0
BLAKE2b-256 checksum
How to use checksums
0787943241db890c9ebe5cf79b7f2a2dde360692db4d8871010364167224fd4b
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

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.

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page