Skip to main content

A library to download (and cache) fonts with Fontsource REST API

Project description

fontsource-downloader

Python Rust codecov docs.rs Crates.io PyPI

A library to download (and cache) fonts with fontsource REST API.

Library Features

  • Download a batch of fonts per family (based on the given query).
  • Asynchronous downloads with true parallelism.
  • Generate CSS @font-face rules. Both CDN URLs and self-hosting (relative path) URLs are supported. Self-hosted font files can be optionally copied from cache to a given destination directory.
  • Caching enabled (with option to customize cache root dir) for both metadata and font files.
  • Minimal debug logs (when enabled).

Rust consumers get to choose their desired TLS backend. Only the required features of the reqwest crate are enabled.

Examples

Python

import asyncio # the only supported async runtime in python
from pathlib import Path
# enable logging before importing this library
from fontsource_downloader import FontQuery, FontSourceClient, Weight

client = FontSourceClient()
query = FontQuery(
    family="Roboto",
    weights=[Weight(400)],
)
font_file: Path = await client.download_font(&query)
# do what you want with the cached font file ...

Rust

use std::path::PathBuf;
use fontsource_downloader::{
    FontQuery, FontSourceClient, QueryBuilder, Weight,
};

let client = FontSourceClient::new().unwrap();
let query: FontQuery = QueryBuilder::new("Roboto")
    .with_weight(Weight::from(400))
    .build();
let font_file: PathBuf = client.download_font(&query).await.unwrap();
// do what you want with the cached font file ...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fontsource_downloader-0.3.0.tar.gz (85.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fontsource_downloader-0.3.0-cp310-abi3-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10+Windows x86-64

fontsource_downloader-0.3.0-cp310-abi3-win32.whl (2.3 MB view details)

Uploaded CPython 3.10+Windows x86

fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ s390x

fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (3.7 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ppc64le

fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (2.8 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ i686

fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARMv7l

fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.9 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

fontsource_downloader-0.3.0-cp310-abi3-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

fontsource_downloader-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file fontsource_downloader-0.3.0.tar.gz.

File metadata

  • Download URL: fontsource_downloader-0.3.0.tar.gz
  • Upload date:
  • Size: 85.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for fontsource_downloader-0.3.0.tar.gz
Algorithm Hash digest
SHA256 279a4abdb9bb76befa8e1f21ae2c983817cf18a8386973e3948afed0cabb4ed1
MD5 33780baf9bcb1d74fb94061e167f8da6
BLAKE2b-256 1ddc521ea7fb9911a71535a1a7d3218015ef195d940cf889f7d12114757d47e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.0.tar.gz:

Publisher: python.yml on 2bndy5/fontsource-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontsource_downloader-0.3.0-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 74a94658c1ad080073ca4271d5be5c25917e300aabeaf562ed76652f9b126d66
MD5 96b0cb5de550db38bdc28ba3e34ff152
BLAKE2b-256 52673f01cc8b285a3d6a11386bd31749669b4a3bf026ca1d7b4902d007c3a504

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.0-cp310-abi3-win_amd64.whl:

Publisher: python.yml on 2bndy5/fontsource-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontsource_downloader-0.3.0-cp310-abi3-win32.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.0-cp310-abi3-win32.whl
Algorithm Hash digest
SHA256 10c2e4d4534bfa08fe33f8214573d292231b929082993ef7d60a79e015003385
MD5 1860f098b52b02ffdad3e045a205322f
BLAKE2b-256 f3b70128a8d6538fb4a753f059f00a903863857b0a1bb9e135bbb224f22962cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.0-cp310-abi3-win32.whl:

Publisher: python.yml on 2bndy5/fontsource-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 60d8613866928023743ef0a4fcb3ed8446e4ecf1a47876182180ef83b42d9862
MD5 a4b684858bb03bac1f789418b319e7d2
BLAKE2b-256 e9e7e070f51bffce9f1a784b0ae9d14568925437e590e70f7fc8ee305f821c13

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python.yml on 2bndy5/fontsource-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 1e7aaa7346f9a6532f1dec1b8aa0573efbd51741280c74b9fa5bf972c8deb549
MD5 ac3cc67a4dfeb94caec843d1335122a9
BLAKE2b-256 f52a26bd1161cc7c92bef083ff7eeb643478c21856db058595fd96e6ce132231

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl:

Publisher: python.yml on 2bndy5/fontsource-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 34106d197da030305cf29f953d26c2788b5d518138442113a2a0c0ae3f41581f
MD5 ebcc5d45ed907073521658503bef61b3
BLAKE2b-256 1a6739dbf0c3b8f4c0148a83254772be209e8e434b57cc230858c9a5083794a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl:

Publisher: python.yml on 2bndy5/fontsource-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 001a29f9c8aed2dc3d1dba56cbfe0434369bdabfb95855b2730a971195e0a673
MD5 130303252121e609a0fb97a166f2b825
BLAKE2b-256 43631831adb1b6be88c5e7364a65aa9ea5aed6a4d40bc43f8f54146dd86feafa

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: python.yml on 2bndy5/fontsource-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 aea5842c032d8825475faedfb91cf267d41618b59fd4ba872d9ea84b2b6fe721
MD5 148e9461348473c75626fe6af01a19c9
BLAKE2b-256 4fb2f2461caa179cc08d85191068076612b487284ddc6f8949a2bee8e3a4f967

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl:

Publisher: python.yml on 2bndy5/fontsource-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 91722a4a35c61c64b09f6c97195d54594f51fb317b790ef315b35e0b1623bfb2
MD5 7b8632c99e9da8cc222cc5ff361c4a31
BLAKE2b-256 b1308850b28239236d2f964fd5164ff3dce0edf20cf1f6dc5143293e76f298d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python.yml on 2bndy5/fontsource-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontsource_downloader-0.3.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4ef5c406473f67065b9d5b0d911e30c6da5ecc8f5787c3b7f1cfd278b7093844
MD5 387b5cce8c96230c71da0a067e199fd9
BLAKE2b-256 eb59d4a79347f6693b9876180cb54feee11e94a155b3d6f91db8ff05b349343a

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: python.yml on 2bndy5/fontsource-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontsource_downloader-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bfd9e33abe3f8012a526af89ab7cf5693fc2539b0ccd53cc9ec0d07bbc53e190
MD5 396c761f60f4c828d3a8ae6dcefa3220
BLAKE2b-256 b63cce4b0a65b321a7c579b9747ac61f7d08fe19a0510d9507a63cccee40fca5

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: python.yml on 2bndy5/fontsource-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page