Skip to content

UrlGenerator generator

Generate locale-aware URLs with optional allowed schemes.

Why: Use UrlGenerator for locale-aware web-address fixtures constrained to allowed schemes; use DomainGenerator when only the host name is required.

Category: net.

Output: str.

1
<key name="value" generator="UrlGenerator(locale='en_US', schemes=['https'])"/>

Parameters

  • locale: str | null; Default None — Faker locale used to generate URL components.
  • schemes: list[str] | null; Default None — Allowed URI schemes; generated values are rewritten to one of these schemes.