icalendar.prop.float module#

FLOAT values from RFC 5545.

class icalendar.prop.float.vFloat(*args, params=None, **kwargs)[source]#

Bases: float

Float

Value Name:

FLOAT

Purpose:

This value type is used to identify properties that contain a real-number value.

Format Definition:

This value type is defined by the following notation:

float      = (["+"] / "-") 1*DIGIT ["." 1*DIGIT]
Description:

If the property permits, multiple "float" values are specified by a COMMA-separated list of values.

Example:

1000000.0000001
1.333
-3.14
>>> from icalendar.prop import vFloat
>>> float = vFloat.from_ical('1000000.0000001')
>>> float
1000000.0000001
>>> float = vFloat.from_ical('1.333')
>>> float
1.333
>>> float = vFloat.from_ical('+1.333')
>>> float
1.333
>>> float = vFloat.from_ical('-3.14')
>>> float
-3.14
default_value: ClassVar[str] = 'FLOAT'#
classmethod examples()[source]#

Examples of vFloat.

Return type:

list[Self]

classmethod from_ical(ical)[source]#
Return type:

Self

classmethod from_jcal(jcal_property)[source]#

Parse jCal from RFC 7265.

Parameters:

jcal_property (list) – The jCal property to parse.

Raises:

JCalParsingError – If the jCal provided is invalid.

Return type:

Self

classmethod from_xcal(xml)[source]#

Parse xCal according to RFC 6321.

Parameters:
  • parser – Required. The xCal to parse or a parser.

  • params – Required. The parameters of the xCal element.

Raises:

XCalParsingError – If the provided xCal is invalid.

Return type:

VProp

property ical_value: float#

Converts the FLOAT property type according to RFC 5545 Section 3.3.7 to a Python float.

params: Parameters#
to_ical()[source]#
Return type:

bytes

to_jcal(name)[source]#

The jCal representation of this property according to RFC 7265.

Return type:

list

to_xcal(element)[source]#

Add the xCal representation of this property according to RFC 6321.

Return type:

None