castsΒΆ

This module contains logic for casting string values to native python types.

Except for str2bool() and str2timedelta(), these are mostly just thin wrappers around built-in methods, and only provided for convenience.

Functions

str2bool(value)

Parse a string into a boolean value.

str2date(value)

Parse a string into a date value using ISO format.

str2datetime(value)

Parse a string into a datetime value using ISO format.

str2float(value)

Parse a string into a float value.

str2int(value)

Parse a string into an integer value.

str2json(value)

Parse a JSON string into a Python object.

str2path(value)

Parse a string into a Path object.

str2time(value)

Parse a string into a time value using ISO format.

str2timedelta(value)

Parse a string into a timedelta.

str2url(value)

Parse a string into a URL ParseResult object.