An open API service indexing awesome lists of open source software.

https://answerdotai.github.io/fa6-icons/

fontawesome 6 free icons as SVGs
https://answerdotai.github.io/fa6-icons/

Last synced: about 2 months ago
JSON representation

fontawesome 6 free icons as SVGs

Awesome Lists containing this project

README

        

# fa6-icons

This module provides the free icons from [Font
Awesome](https://fontawesome.com/) v6 in a python-friendly form.

The actual SVGs and associated data are licensed on the same terms as
the originals – this package only adds a little on top to make them
easier to use from Python.

## Install

``` sh
pip install fa6_icons
```

…or…

``` sh
conda install -c fastai fa6_icons
```

## How to use

Two objects are provided, `svgs` and `dims`.

``` python
from fa6_icons import svgs,dims
```

These are both [AttrDict](https://fastcore.fast.ai/basics.html#attrdict)
objects, which behave as dicts, but can also be accessed with
dotted-attrs. They contain the same keys. To search them, use standard
python dict approaches, e.g:

``` python
[o for o in svgs if 'addr' in o]
```

['address_book', 'address_card']

Each style is available as a key for each SVG and dims entry, e.g:

``` python
dims.address_card
```

``` json
{'regular': (512, 576), 'solid': (512, 576)}
```

In a notebook environment, SVGs are displayed:

``` python
svgs.address_card.regular
```

To make attr access more convenient, hyphens are replaced with
underscores, and icon names starting with a digit are prefixed with an
underscore.

Use `width` to view the svg in a notebook with a different width (it
defaults to 300px).

``` python
svgs._9.solid.width(25)
```

When stringified, the SVG text is returned:

``` python
print(svgs._9.solid)
```