Parser#

class Parser(**properties: Any)#

Superclasses: Object, Object

This is the ICalParser instance.

Constructors#

class Parser
classmethod new() Parser#

Creates a default Parser.

Added in version 1.0.

Methods#

class Parser
add_line(str: str | None = None) Component | None#

Add a line at one time into the Parser until the parsing is complete and Component will be returned.

Added in version 1.0.

Parameters:

str – A line of string representation of the Component

clean() Component | None#

We won’t get a clean exit if some components did not have an “END” tag. Clear off any component that may be left in the list.

Added in version 1.0.

free() None#

Frees a Parser.

Added in version 1.0.

get_line(func: Callable[[list[int], Any], str], user_data: Any = None) str#

Given a line generator function, returns a single iCal content line.

Added in version 1.0.

Parameters:
  • func – A line generator function

  • user_data – The data given to func

get_state() ParserState#

Gets the state of the target parser.

Added in version 1.0.

parse(func: Callable[[list[int], Any], str], user_data: Any = None) Component#

icalparser_parse takes a string that holds the text ( in RFC 2445 format ) and returns a pointer to an Component. The caller owns the memory. func is a pointer to a function that returns one content line per invocation.

Added in version 1.0.

Parameters:
  • func – The function used to parse

  • user_data – The data given to func

classmethod parse_string() Component#

Parses the string into a Component.

Added in version 1.0.