datalad_next.constraints.EnsureURL

class datalad_next.constraints.EnsureURL(required: list | None = None, forbidden: list | None = None, match: str | None = None)[source]

Bases: Constraint

Ensures that a string is a valid URL with a select set of components

and/or:

  • does not contain certain components

  • matches a particular regular expression

Given that a large variety of strings are also a valid URL, a typical use of this constraint would involve using a required=['scheme'] setting.

All URL attribute names supported by urllib.parse.urlparse() are also supported here: scheme, netloc, path, params, query, fragment, username, password, hostname, port.

short_description()[source]

This method is deprecated. Use input_synopsis instead