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
# configure logging before importing this library
from fontsource_downloader import (
  FontQuery, FontSourceClient, Weight
)

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

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_files: Vec<PathBuf> = client
    .download_font(&query)
    .await
    .unwrap();
// do what you want with the cached font files ...

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.1.tar.gz (133.1 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.1-cp310-abi3-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10+Windows x86-64

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

Uploaded CPython 3.10+Windows x86

fontsource_downloader-0.3.1-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.1-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.1-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.1-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.1-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.1-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.1-cp310-abi3-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

fontsource_downloader-0.3.1-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.1.tar.gz.

File metadata

  • Download URL: fontsource_downloader-0.3.1.tar.gz
  • Upload date:
  • Size: 133.1 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.1.tar.gz
Algorithm Hash digest
SHA256 709d5da43c2379dad4ab9771d5f69b44368402b0bfbe7dd63b79a23725ce1e6a
MD5 b4121cf72e624084c01b35c1282fdd97
BLAKE2b-256 04f33cc77094471be9d07db37522a3f8509ebca93b9e2cd97b23463c433b72b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.1.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.1-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 04e50d2bf84fab8f275da526b13e27c085776cd18c053683297f822cfe1b0f1a
MD5 3eadc4438fc5300ac6545838995102a8
BLAKE2b-256 e0f89910d97952ccc10ab3de0831962716b14471d296690e869b0ba36efe1656

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.1-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.1-cp310-abi3-win32.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.1-cp310-abi3-win32.whl
Algorithm Hash digest
SHA256 aeca031239296dd4441d770ecd114ce80989af0805229c1056f9dfab4ecae4ce
MD5 6c17bcd8780daa187972c67697acf5ea
BLAKE2b-256 38775de44bb786691b29a701739e83fb95ee95ef03cac801b2f6a4c702955bb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.1-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.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ef05b058cd950e59f7e0cc94faf272ac51e74a54498215a358e6213eda726be4
MD5 621e9fe3e2821f7dacdf2939d1339da7
BLAKE2b-256 8c161cdbce5c11dd54755b5d588b912bb92eacb0f0513627e9bb42accaf6af2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.1-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.1-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.1-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 c0fd338724560235f5c2d5c4f26e81b613b9fb0d463a17dcaa0a37f26bfe4ac4
MD5 da9712935d628f24ae131f76e495cb39
BLAKE2b-256 567860953a54503d1ecaf5edfae43e12d3bcf5a9ca25e5da9730f72b96c5bd82

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.1-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.1-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.1-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 93d08c15a2c9f80a6c418375add35134a278ec28eb7205f73ba58bf2c5955a31
MD5 db070beb09f632ae9b95e650ab576d07
BLAKE2b-256 328f0f2de49fd9c16ba3ed98a228a163818734ed3345ea859d85fdda7c81c03b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.1-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.1-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.1-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 cc8dcd1399dd669756ebef1e3ef435cce3ef4d7a21109c2285d0733647e45549
MD5 3749275e89931fb7012a1f9fc11ecda0
BLAKE2b-256 00a0c4365b1319dccc62eb155a68bc13809ab40cd346a2208f39d10a831c5d66

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.1-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.1-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.1-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 2b7dcef494737a1888a7a2d36f2e5d647c62f42be158b21f5b5cc2e6c56b2638
MD5 35d7f190c5dc7fe4dc7447f61c6063d9
BLAKE2b-256 65c4648894896426429a54bd85a29b7ba67c49b8d6037a9250df67c35288ca0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.1-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.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 50625446978f8062dae257b2f9831bc336d6ec3328d41b8457a4bfb82c7db954
MD5 65d1f9fa904340127bb08054acec450c
BLAKE2b-256 91b11e51ce6c2915632a099abcc980090f6391f0b05677f094f12b150a2a57d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.1-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.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2b4889969e71c0f10144fc7ca975c28d02463196337d2600ea155ab7cb68bd3b
MD5 41050c84e09c1054c36e555383ab6889
BLAKE2b-256 c6d0ff7107318545a2529f3e27e9aa0e1c6484dde47ad70261c405012dc296e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.1-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.1-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fontsource_downloader-0.3.1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b697899d4074e72c35ecce2f0930cb246c05cf1002ff0cf7339a3488cb78cb88
MD5 76a5a819dd443fcf713477f2a1c63a0b
BLAKE2b-256 68d4f30e3bf6b5a67de9e6b15655e3c49614b3b731b1aab90c1b2d675a9c6f01

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontsource_downloader-0.3.1-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