trackhub.helpers.sanitize

trackhub.helpers.sanitize(s, strict=True)[source]

Sanitize a string.

Spaces are converted to underscore; if strict=True they are then removed.

Parameters
  • s (str) – String to sanitize

  • strict (bool) – If True, only alphanumeric characters are allowed. If False, a limited set of additional characters (-._) will be allowed.