Skip to main content

Pycons

PyPI License Package status Monthly downloads Distribution format Wheel availability Python version Implementation Releases Github Contributors Github Forks Github Issues Github Issues Github Watchers Github Stars Github Repository size Github last commit Github release date Github language count Github commits this month Package status PyUp

Read the documentation!

Icon utilities for Python: resolve icon names from popular icon fonts to Unicode characters and font files, fetch SVGs and icon sets from Iconify, build favicon URLs and pick emoji icons for file paths.

Installation

pip install pycons

Requires Python 3.13+.

Quickstart

Icon fonts

Icons are addressed as prefix.name. The font and its codepoint mapping are downloaded on first use and cached in the user cache directory.

import asyncio

from pycons import get_icon, get_icon_sync

icon = get_icon_sync("fa.heart")
print(icon.character, icon.ttf_path)  # Unicode character + path to the TTF file

icon = asyncio.run(get_icon("mdi.home"))

Iconify-style identifiers are supported for the bundled fonts as well:

import asyncio

from pycons.functional import get_icon_from_iconify_id

icon = asyncio.run(get_icon_from_iconify_id("material-symbols:home-rounded"))
Prefix Font Iconify prefix
fa / fas / fab Font Awesome 6 Regular / Solid / Brands fa6-regular / fa6-solid / fa6-brands
mdi Community Material Design Icons mdi
mso / msr / mss Google Material Symbols Outlined / Rounded / Sharp material-symbols (-outline, -rounded, -sharp suffix)
msc VS Code Codicons codicon
ph Phosphor ph
ri Remix Icon ri
el Elusive Icons el

Iconify

pycons.iconify.api wraps the Iconify API for per-icon requests and loads whole icon sets from the @iconify-json/* npm packages via CDN (jsDelivr, falling back to unpkg), since the public API is rate-limited for bulk use.

from pycons.iconify import api

svg = api.svg("mdi:home", color="red", height=24)  # bytes
result = api.search("arrow", limit=32)
mdi = api.icon_set("mdi")  # full IconifyJSON data
sets = api.collections("mdi", "fa6-")  # metadata of matching icon sets

Errors are raised as IconNotFoundError, IconifyRateLimitError or IconifyError (pycons.iconify.errors). The endpoints can be overridden with the PYCONS_ICONIFY_API and PYCONS_ICONIFY_CDN (comma-separated) environment variables.

Favicons and file icons

from pycons.asciicons import get_path_ascii_icon
from pycons.favicon import get_favicon

get_favicon("https://github.com", provider="google", size=64)  # favicon URL
get_path_ascii_icon("script.py")  # "🐍"

Features

  • 11 icon fonts behind one prefix.name lookup, with async and sync APIs
  • Cached downloads; set GITHUB_TOKEN to avoid GitHub rate limits when fetching fonts
  • Typed Iconify wrapper: SVG, CSS, search, keywords, icon data and full icon sets
  • Favicon URL builder for Google, DuckDuckGo, Icon Horse, Yandex, favicon.io and favicon.ninja
  • Emoji icons for files and folders by extension (works with upath paths)

Documentation

See the documentation for the API reference.

Metadata

Release files for pycons 1.2.0

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

Source distribution (sdist)

Source distribution for pycons 1.2.0
File Size Uploaded Provenance Actions
pycons-1.2.0.tar.gz 26.0 kB With provenance Details for pycons-1.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 53.0 kB

Release files / pycons-1.2.0.tar.gz

Download URL pycons-1.2.0.tar.gz
Size 26.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e99710d5a3fb8758967252b3aff09e7fca3c8eef15234b769577d173eddcbf4f
BLAKE2b-256 checksum
How to use checksums
e9e229575fdd4e3172ef188bcb79c727a3c968a665eaad78c1b1a46349fa2e6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / pycons-1.2.0-py3-none-any.whl

Download URL pycons-1.2.0-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b6da02496236cd6d2dff3373b8b092a1cd875bd34bffb747ac7aab33ca22cec
BLAKE2b-256 checksum
How to use checksums
ea7266449edfb8d1cc25020a359c08b4b00613b313c54d1ed2416e91f2da131a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for pycons 1.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pycons-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

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.

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