OpenQuizz
Une application de gestion des contenus pédagogiques
|
Data Structures | |
class | |
class | int_range |
class | regex |
class | URL |
Functions | |
def | ipv4 (value) |
def | ipv6 (value) |
def | ip (value) |
def | iso8601interval (value, argument="argument") |
def | date (value) |
def | natural (value, argument="argument") |
def | positive (value, argument="argument") |
def | boolean (value) |
def | datetime_from_rfc822 (value) |
def | datetime_from_iso8601 (value) |
def | date_from_iso8601 (value) |
Variables | |
START_OF_DAY = time(0, 0, 0, tzinfo=pytz.UTC) | |
END_OF_DAY = time(23, 59, 59, 999999, tzinfo=pytz.UTC) | |
netloc_regex | |
email_regex | |
time_regex = re.compile(r"\d{2}:\d{2}") | |
url | |
def flask_restx.inputs.boolean | ( | value | ) |
Parse the string ``"true"`` or ``"false"`` as a boolean (case insensitive). Also accepts ``"1"`` and ``"0"`` as ``True``/``False`` (respectively). If the input is from the request JSON body, the type is already a native python boolean, and will be passed through without further parsing. :raises ValueError: if the boolean value is invalid
def flask_restx.inputs.date | ( | value | ) |
Parse a valid looking date in the format YYYY-mm-dd
def flask_restx.inputs.date_from_iso8601 | ( | value | ) |
Turns an ISO8601 formatted date into a date object. Example:: inputs.date_from_iso8601("2012-01-01") :param str value: The ISO8601-complying string to transform :return: A date :rtype: date :raises ValueError: if value is an invalid date literal
def flask_restx.inputs.datetime_from_iso8601 | ( | value | ) |
Turns an ISO8601 formatted date into a datetime object. Example:: inputs.datetime_from_iso8601("2012-01-01T23:30:00+02:00") :param str value: The ISO8601-complying string to transform :return: A datetime :rtype: datetime :raises ValueError: if value is an invalid date literal
def flask_restx.inputs.datetime_from_rfc822 | ( | value | ) |
Turns an RFC822 formatted date into a datetime object. Example:: inputs.datetime_from_rfc822('Wed, 02 Oct 2002 08:00:00 EST') :param str value: The RFC822-complying string to transform :return: The parsed datetime :rtype: datetime :raises ValueError: if value is an invalid date literal
def flask_restx.inputs.ip | ( | value | ) |
Validate an IP address (both IPv4 and IPv6)
def flask_restx.inputs.ipv4 | ( | value | ) |
Validate an IPv4 address
def flask_restx.inputs.ipv6 | ( | value | ) |
Validate an IPv6 address
def flask_restx.inputs.iso8601interval | ( | value, | |
argument = "argument" |
|||
) |
Parses ISO 8601-formatted datetime intervals into tuples of datetimes. Accepts both a single date(time) or a full interval using either start/end or start/duration notation, with the following behavior: - Intervals are defined as inclusive start, exclusive end - Single datetimes are translated into the interval spanning the largest resolution not specified in the input value, up to the day. - The smallest accepted resolution is 1 second. - All timezones are accepted as values; returned datetimes are localized to UTC. Naive inputs and date inputs will are assumed UTC. Examples:: "2013-01-01" -> datetime(2013, 1, 1), datetime(2013, 1, 2) "2013-01-01T12" -> datetime(2013, 1, 1, 12), datetime(2013, 1, 1, 13) "2013-01-01/2013-02-28" -> datetime(2013, 1, 1), datetime(2013, 2, 28) "2013-01-01/P3D" -> datetime(2013, 1, 1), datetime(2013, 1, 4) "2013-01-01T12:00/PT30M" -> datetime(2013, 1, 1, 12), datetime(2013, 1, 1, 12, 30) "2013-01-01T06:00/2013-01-01T12:00" -> datetime(2013, 1, 1, 6), datetime(2013, 1, 1, 12) :param str value: The ISO8601 date time as a string :return: Two UTC datetimes, the start and the end of the specified interval :rtype: A tuple (datetime, datetime) :raises ValueError: if the interval is invalid.
def flask_restx.inputs.natural | ( | value, | |
argument = "argument" |
|||
) |
Restrict input type to the natural numbers (0, 1, 2, 3...)
def flask_restx.inputs.positive | ( | value, | |
argument = "argument" |
|||
) |
Restrict input type to the positive integers (1, 2, 3...)
email_regex |
END_OF_DAY = time(23, 59, 59, 999999, tzinfo=pytz.UTC) |
netloc_regex |
START_OF_DAY = time(0, 0, 0, tzinfo=pytz.UTC) |
time_regex = re.compile(r"\d{2}:\d{2}") |
url |