icalendar.prop.integer module#
INT values from RFC 5545.
- class icalendar.prop.integer.vInt(*args, params=None, _validate_range=True, **kwargs)[source]#
Bases:
intInteger
- Value Name:
INTEGER
- Purpose:
This value type is used to identify properties that contain a signed integer value.
- Format Definition:
This value type is defined by the following notation:
integer = (["+"] / "-") 1*DIGIT
- Description:
If the property permits, multiple "integer" values are specified by a COMMA-separated list of values. The valid range for "integer" is -2147483648 to 2147483647. If the sign is not specified, then the value is assumed to be positive.
The
__new__method creates a vInt instance:- Parameters:
- Returns:
vInt instance
- Raises:
ValueError – If the value is outside the RFC 5545 signed 32-bit integer range as defined in
minandmax.
Examples
1234567890 -1234567890 +1234567890 432109876
>>> from icalendar.prop import vInt >>> integer = vInt.from_ical('1234567890') >>> integer 1234567890 >>> integer = vInt.from_ical('-1234567890') >>> integer -1234567890 >>> integer = vInt.from_ical('+1234567890') >>> integer 1234567890 >>> integer = vInt.from_ical('432109876') >>> integer 432109876
Create a PRIORITY property (1 = highest priority):
>>> priority = vInt(1) >>> priority 1 >>> priority.to_ical() b'1'
Create SEQUENCE property (for versioning):
>>> sequence = vInt(3) >>> sequence.to_ical() b'3'
- XCAL_TYPE = 'xsd:integer'#
- classmethod from_jcal(jcal_property)[source]#
Parse jCal from RFC 7265.
- Parameters:
jcal_property (
list) – The jCal property to parse.- Raises:
JCalParsingError – If the provided jCal is invalid.
- Return type:
- 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
- classmethod from_xcal_element(element, params)[source]#
Parse xCal according to RFC 6321.
- Parameters:
element (
ElementAdapter) – Required. The xCal element to parse.params (
Parameters) – Required. The parameters of the xCal element.
- Raises:
XCalParsingError – If the provided xCal is invalid.
- Return type:
- classmethod from_xcal_in_recur(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: int#
INTEGER property type according to RFC 5545 Section 3.3.8
- max: ClassVar[int] = 2147483647#
The maximum valid value per RFC 5545 Section 3.3.8 (
2147483647).- Type:
- min: ClassVar[int] = -2147483648#
The minimum valid value per RFC 5545 Section 3.3.8 (
-2147483648).- Type:
- params: Parameters#
- classmethod parse_jcal_value(value)[source]#
Parse a jCal value for vInt.
- Raises:
JCalParsingError – If the value is not an int.
- Return type:
- class icalendar.prop.integer.vNonNegativeInt(*args, params=None, _validate_range=True, **kwargs)[source]#
Bases:
vIntThis is an integer that is at least 0.
See https://www.rfc-editor.org/rfc/inline-errata/rfc6321.html#btn_3050
- XCAL_TYPE = 'xsd:nonNegativeInteger'#
- min: ClassVar[int] = 0#
The minimum valid value per RFC 5545 Section 3.3.8 (
-2147483648).- Type: