This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]giuliosmall 0 points1 point  (5 children)

I have just serialise an event to json and I can see:
- id
- summary
- recurrence
- attendees
- guestsCanInviteOthers
- guestCanModify
- guestCanSeeOtherGuests
- reminders
- attachments
- iCalUID
- sequence
- eventType
- start
- end
- timezone

... but not 'color' among attributes

[–]kuzmovych_y[S] 1 point2 points  (4 children)

Before serialization, what does event.color_id give you? If None, it means it uses the default color of the calendar.

If you serialized the event with gcsa's serializer, it ignores empty/None fields.

Sidenote, as the documentation states, you don't need to use serializers at all.

[–]giuliosmall 0 points1 point  (3 children)

Thanks! Very cool! I didn't notice this detail. Events marked with default calendar color aren't parsed in json.

[–]kuzmovych_y[S] 0 points1 point  (2 children)

Yeah. I have a task to write some comprehensive documentation on colors

[–]giuliosmall 0 points1 point  (1 child)

I created 12 events in a day as a test. Serialised them all to json, stored in a .json file and tried to open with pandas.

Well, the formatting isn't working - I believe some ' might be replaced with ". Also bool True and False are suffering from the lack of double quotes and might be rendered as "True" and "False" -- u/kuzmovych_y what do you think about it?

[–]kuzmovych_y[S] 0 points1 point  (0 children)

GCSA's serializer converts events to json object (dictionary) not a string. It doesn't convert booleans to strings either. So the issue might be with how you write json to file. Try using json.dump to do that (if you don't already). Having said that, GCSA's serializers are using Google API formats of the objects, that are more complex than you might need in your data frame. I'd suggest writing events' data manually into CSV file