Skip to main content

Font-Awesome-Flask

PyPI Supported Python Versions pre-commit.ci status Imports: isort Code style: black Checked with mypy PyPI - License

Font-Awesome-Flask is an extension for Flask that adds support for Font Awesome to your web application. It adds methods to load Font Awesome's resources (both Web Fonts + CSS and SVG + JS are supported) and render icons.

Installation

From PyPI

Font-Awesome-Flask is available on PyPI. Install with pip or your package manager of choice:

python3 -m pip install --upgrade font-awesome-flask

From source

If you'd like, you can also install Font-Awesome-Flask from source (with flit):

git clone https://github.com/sgraaf/font-awesome-flask.git
cd font-awesome-flask
python3 -m pip install flit
python3 -m flit install

Example

Initialization

Initialize the extension...:

from flask import Flask
from flask_font_awesome import FontAwesome

app = Flask(__name__)
font_awesome = FontAwesome(app)

... or using the Application Factory pattern:

from flask import Flask
from flask_font_awesome import FontAwesome

app = Flask(__name__)

font_awesome = FontAwesome()
font_awesome.init_app(app)

Loading resources

Font-Awesome-Flask provides three helper methods to load Font Awesome's resources: font_awesome.load(), font_awesome.load_js() and font_awesome.load_css().

Font Awesome can be used either via Web Fonts + CSS or via SVG + JS. Use the load_css() method for the former, and load_js() for the latter. You can also use the more general load(), which defaults to SVG + JS.

Whichever resource(s) you end up using, you can load them by including any of the load() methods in the head of your base template:

<head>
    ...
    {{ font_awesome.load_js() }}
    ...
</head>
<body>
    ...
</body>

Rendering icons

Font-Awesome-Flask provides two ways of rendering icons: via the font_awesome.render_icon() and font_awesome.render_stacked_icons() methods...:

{{ font_awesome.render_icon('fas fa-house') }}
{{ font_awesome.render_stacked_icons('fas fa-square', 'fas fa-house') }}

... or via the Jinja macros of the same names:

{% from 'font_awesome.html' import render_icon, render_stacked_icons %}

{{ render_icon('fas fa-house') }}
{{ render_stacked_icons('fas fa-square', 'fas fa-house') }}

Metadata

Release files for font-awesome-flask 0.1.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 font-awesome-flask 0.1.0
File Size Uploaded Provenance Actions
Font-Awesome-Flask-0.1.0.tar.gz 569.8 kB Without provenance Details for Font-Awesome-Flask-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for font-awesome-flask 0.1.0
File Interpreter ABI Platform Actions
font_awesome_flask-0.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for font_awesome_flask-0.1.0-py2.py3-none-any.whl

Total release size: 1.1 MB

Release files / Font-Awesome-Flask-0.1.0.tar.gz

Download URL Font-Awesome-Flask-0.1.0.tar.gz
Size 569.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c63741bf90c071e3ba2b9a30db18557886198c952b7c93a86acd10a8d56642c7
BLAKE2b-256 checksum
How to use checksums
ce9e667bdbb937c5647fd9f57508832907acb328133e9118e9b2dee60a1cec12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release files / font_awesome_flask-0.1.0-py2.py3-none-any.whl

Download URL font_awesome_flask-0.1.0-py2.py3-none-any.whl
Size 568.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2ce54ebc26905059f39b838bfedf1d75debbf7a1dbd6114c42f33416f3490406
BLAKE2b-256 checksum
How to use checksums
447c25a5049eb70ff6a053b6494c1ed24cab54c11beb788b2df686ebdd3163a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Security for font-awesome-flask 0.1.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.

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.

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