You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this is far from perfect, especially since the resulting dict only has strings as values, and do not take benefit from the parsing abilities from icalendar. Typically, fields representing dates and times are converted to string instead of staying as datetime objects, which would be much more porwerful.
Looking at the ical.prop files and the API documentation, I could not find a way to get the "decoded" (Python typed) value from a given prop, to use in the to_dict function. I came accross #85 which is kind of similar, but strings are perfectly fine in this particular case.
Is there a way to achieve something like this?
Thanks!
EDIT: Actually, due to #127, the above solution is not even really working.
What I came with which is more closely working is
Decoding a value should be possible with icalendar.cal.types_factory.from_ical, but that method isn't part of the public API.
At some point I guess it'd be nice to support jCalendar, and maybe also pass jCalendar from the raw parser to cal (instead of the contentline abstraction).
Using a dictionary is not appropriate seen that CALDAV events can contain multiple components (multiple "VEVENT" in recurrent events) and subcomponents ( "ATTENDEE') in one event. See page 9 in )
Dictionary's cannot have two items with the same key. Converting "BEGIN:VEVENT" to a "key:value" dictionary element wont work while the second occurrence of a "VEVEN" component will crush the first.
Hi,
I am looking for a way to convert
icalendar
events to Pythondict
of the values (back and forth between Pythondict
andicalendar.Event
).For now, my solution is to:
However, this is far from perfect, especially since the resulting
dict
only has strings as values, and do not take benefit from the parsing abilities fromicalendar
. Typically, fields representing dates and times are converted to string instead of staying asdatetime
objects, which would be much more porwerful.Looking at the
ical.prop
files and the API documentation, I could not find a way to get the "decoded" (Python typed) value from a given prop, to use in theto_dict
function. I came accross #85 which is kind of similar, but strings are perfectly fine in this particular case.Is there a way to achieve something like this?
Thanks!
EDIT: Actually, due to #127, the above solution is not even really working.
What I came with which is more closely working is
The text was updated successfully, but these errors were encountered: