edmt.mapping.carto

Module Contents

edmt.mapping.carto._load_font(name: str, size: int)

Safely load a TrueType font with a fallback.

edmt.mapping.carto.make_qr(url: str, label: str, short_url: str | None = None, size: int = 180, foreground: str = '#1B3A2D', background: str = 'white', muted: str = '#555555') PIL.Image.Image

Generate a QR code image with a label and optional short URL.

Parameters

urlstr

URL to encode in the QR code.

labelstr

Title displayed below the QR code.

short_urlstr, optional

Shortened URL displayed below the label.

sizeint, default=180

Width and height of the QR code in pixels.

foregroundstr, default='#1B3A2D'

QR code and label color.

backgroundstr, default='white'

Background color.

mutedstr, default='#555555'

Color of the short URL text.

Returns

PIL.Image.Image

QR code image with annotations.