citry-phosphor-icons
Phosphor Icons as citry components.
Install
pip install citry-phosphor-icons
import citry_phosphor_icons
from citry import Citry
app = Citry()
citry_phosphor_icons.install(app)
Everything else is an argument to that one call:
citry_phosphor_icons.install(
app,
name="ph-icon", # publish as <c-ph-icon /> instead of <c-icon />
weight="bold", # the default weight, which a caller still overrides
style="stroke",
cache=False,
override=MyIcon, # publish your own subclass in its place
)
An invalid weight or style is rejected there, not at the first render.
Use
<c-icon name="house" />
<c-icon name="house" weight="bold" />
<c-icon name="house" style="stroke" c-size="24" color="#ff0000" />
| Kwarg | Type | Default | Description |
|---|---|---|---|
name |
str |
- | Icon name, e.g. "house" |
weight |
str |
regular, or what install() set |
bold, duotone, fill, light, regular, thin |
style |
str |
flat, or what install() set |
flat or stroke |
size |
str or int |
None |
Sets width and height; any CSS length ("1.5rem"), an int is read as px |
color |
str |
None |
Sets CSS color |
mirrored |
bool |
False |
Flips the icon horizontally |
attrs |
dict |
None |
Extra attributes passed to the <svg> element |
class and style from attrs are combined with the component's own, not replaced by them - so passing c-attrs="{'class': 'me-2'}" keeps whatever the component already sets, and size still wins over a conflicting width.
Replacing the component
Kwargs is inherited, so a subclass only declares what it changes. get_attrs() returns what the component sets on the <svg> itself, get_default_attrs() what the caller's attrs may override:
from citry import merge_attrs
from citry_phosphor_icons import Icon
class MyIcon(Icon):
def get_attrs(self, kwargs):
return merge_attrs({"class": "icon"}, super().get_attrs(kwargs))
citry_phosphor_icons.install(app, override=MyIcon)
Yours is published under the same tag, so nothing that renders <c-icon /> has to change.
Search and metadata
The icons, the loader and search over the icon metadata live in py-phosphor-icons, which this package builds on:
from py_phosphor_icons import get_svg, get_svg_inner, icon_names, search_icons
search_icons("arrow left") # ranked, best match first
search_icons("roledex") # matches on tags: address-book
get_svg("house", weight="bold")
The same search answers a wrong name, so <c-icon name="cart" /> raises Did you mean: shopping-cart, shopping-cart-simple, car?, narrowed to icons that exist in the requested weight and style.
Development
uv sync
uv run pytest
uv run ruff check .
uv run ruff format .
The icon set and its metadata are maintained in py-phosphor-icons; the sync scripts live there.
Known icon issues
A few icons are incomplete in the upstream Phosphor release and fail to render in certain weight and style combinations. The current list is maintained in py-phosphor-icons, which is where the icon set is synced.
Metadata
Release files for citry-phosphor-icons 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| citry_phosphor_icons-0.2.0.tar.gz | 45.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| citry_phosphor_icons-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.3 kB
Release files / citry_phosphor_icons-0.2.0.tar.gz
| Download URL | citry_phosphor_icons-0.2.0.tar.gz |
|---|---|
| Size | 45.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6370c351c5a7ccb7b30b8c30673dfde67f90608fe2215fc2af8d3d2c8fcc3cfb
|
|
BLAKE2b-256 checksum How to use checksums |
92a8ed04a90fb6893f0430aa9c9f67610cddb4979e534b7cbbdc04137730ff47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 11, 2026.
Transparency logRelease files / citry_phosphor_icons-0.2.0-py3-none-any.whl
| Download URL | citry_phosphor_icons-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4916b5a2a4e52dc9330c6d4183871e6fd92bb902f4474c4cbb95beb0c1d37b89
|
|
BLAKE2b-256 checksum How to use checksums |
294e084a8dd2f136a40828e8c1f72ef19d17cfbdcbbd0004a01d5d4a1c88440a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 11, 2026.
Transparency log