googlefonts-markup
Overview
This is small utility to handle specs of Google Fonts in my products.
Usage
Simple case
>>> from googlefonts_markup import Font
>>> noto_sans_jp = Font(family_name="Noto Sans JP")
>>> noto_sans_jp.css_url()
'https://fonts.googleapis.com/css2?family=Noto+Sans+JP'
>>> noto_sans_jp.css_tag()
'<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP" rel="stylesheet">'
If you want only URL of CSS, use googlefonts_markup.shortcuts.
>>> from googlefonts_markup.shortcuts import font_css_url
>>> font_css_url("Noto Sans JP")
'https://fonts.googleapis.com/css2?family=Noto+Sans+JP'
With italic
>>> from googlefonts_markup import Axis, Font
>>> red_hat_mono = Font(family_name="Red Hat Mono", axis_list=[Axis(italic=True)])
>>> red_hat_mono.css_url()
'https://fonts.googleapis.com/css2?family=Red+Hat+Mono:ital,wght@1,400'
Extra attributes
>>> from googlefonts_markup import Font, FontSet
>>> noto_sans_jp = Font(family_name="Noto Sans JP")
>>> fontset = FontSet(fonts=[noto_sans_jp], display="swap")
>>> fontset.css_url()
'https://fonts.googleapis.com/css2?family=Noto+Sans+JP&display=swap'
Multiple fonts
>>> from googlefonts_markup import Font, FontSet
>>> noto_sans_jp = Font(family_name="Noto Sans JP")
>>> roboto_mono = Font(family_name="Roboto Mono")
>>> fontset = FontSet(fonts=[noto_sans_jp, roboto_mono], display="swap")
>>> fontset.css_url()
'https://fonts.googleapis.com/css2?family=Noto+Sans+JP&family=Roboto+Mono&display=swap'
Defering on HTML
>>> from googlefonts_markup import Font, FontSet
>>> font = Font(family_name="Noto Sans JP")
>>> font.css_tag(defer=True)
'<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP" rel="preload" as="style" onload="this.onload=null;this.rel=\'stylesheet\'">'
Installation
pip install git+https://github.com/attakei-lab/googlefonts-markup
Metadata
Release files for googlefonts-markup 0.4.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 | Provenance | Actions |
|---|---|---|---|---|
| googlefonts-markup-0.4.0.tar.gz | 7.5 kB | Without provenance | Details for googlefonts-markup-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| googlefonts_markup-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for googlefonts_markup-0.4.0-py3-none-any.whl |
Total release size: 15.4 kB
Release files / googlefonts-markup-0.4.0.tar.gz
| Download URL | googlefonts-markup-0.4.0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b4db0af31c8603de90de8281d4708719fb95f93367a3a34872b5c2ba9bd05f26
|
|
BLAKE2b-256 checksum How to use checksums |
91540a46e5c644cf111ee6bff14f7364a6774dfb970868c8ec3d295f7e1087a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Release files / googlefonts_markup-0.4.0-py3-none-any.whl
| Download URL | googlefonts_markup-0.4.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf218aca6f36ff66f51845ab1e6c6416d97b3388ba37c642eb91a008b6d79359
|
|
BLAKE2b-256 checksum How to use checksums |
28bca2b4203070e82915556ace237482feedf43da8667abfc51762d795207701
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Security for googlefonts-markup 0.4.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.