#2013 (Lino and the Google API (people, calendar, images))
by Luc Saffre · in Developers · assigned to Sharif Mehedi
Résumé
Basic idea: write one or several plugins which synchronize contacts and calendar data to Google using the proprietary Google API. Because that's the easiest way of getting some visible result. To be tested on a temporary Lino Amici instance so that Luc, Hamza and Tonis can test it using their Google accounts.
Concepts sous-jacents
Commentaires
- 3 ans, 7 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : NB : I did Ctrl-C on my sync process I now could see quite some of my Google calendar entries in Lino. Great! There will be more to do once it works as a background task and on a real production site. So this is now waiting for #4783
- 3 ans, 7 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : Let's have a jitsi about this. You worked hard on this and I haven't even seen your work.
- 3 ans, 7 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : There were doctest failures in [url gitlab.com/lino-framework/welfare/-/jobs/3877297442 welfare] caused by the google plugin. And the test suite was right to fail: the extra event states were being added also when google was not installed.
- 3 ans, 7 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : pkg_resources from setuptools is failing to load (import issue) on my python env. weird!
- 3 ans, 7 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : Good work. I wrote some comments in my blog: [url luc.lino-framework.org/blog/2023/0227.html]
- 3 ans, 8 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : I pushed changes to quite some repositories. Please to pp git pull.
- 3 ans, 8 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : I am almost finished with the calendar stuff. The only thing that remains is that what happens when Event.get_calendar() returns None. In which case we would not be able to sync it with google.
- 3 ans, 8 mois ago by Luc Saffre in reply to Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : Spontaneously I'd say noi1e.
- 3 ans, 8 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) (1 reply) : where to put tests for google plugin (synchronization). avanti1, cms1, noi1e not sure?
- 3 ans, 8 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : TODO for @8lurry : doctest docs/specs/cal.rst, build_rrule(), and parse_rrule()
- 3 ans, 8 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : During our session we decided to not (yet) support cases of RecurrenceSet that require multiple RRULE statements.
- 3 ans, 8 mois ago by Luc Saffre in reply to Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : Later the current action should become a system.TaskProcessor, and the "Sycnchonize" button on a calnder would just launch that task.
- 3 ans, 8 mois ago by Luc Saffre in reply to Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : As a first approach I would now write errors to the lino.log file and have the action respond "There were X issues, please consult the log file".
- 3 ans, 8 mois ago by Luc Saffre in reply to Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : If the user or partner doesn't exist: create one. The bigger problem is when we have multiple guests for a given email address. In that case we should consider this as an error, i.e. the synchronization failed. Some site user should get notified about such error messages.
- 3 ans, 8 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) (3 replies) : In the case of an event in google calendar which has some attendees, where each attendee has an email; how should we store such email to reference them in the Guest (if no user exists against such email)?
- 3 ans, 8 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : Or maybe move your work to a branch until it is finished.
- 3 ans, 8 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : @8lurry please adapt the doctests in book after your recent changes. And if possible also add documentation. Ask me on Jitsi if you need help.
- 3 ans, 8 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : In a first step, let's not have every user their calendar synced but let's have a setting google.user_accountor similar, and create Google account for the Jane site, and all users would subscribe to the Jane calendar.
- 3 ans, 8 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : Yes, the 'secondly', 'minutely' & 'hourly' frequencies are something we will need for replacing schedule by a plugin.
- 3 ans, 8 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) (2 replies) : Good question. Let's talk about it. My spontaneous reaction is that this might cause more work than you image now, maybe even changes visible to customers, and nobody will ever pay for it. What advantage would it bring to the end users?
- 3 ans, 8 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : If @luc agrees with this, I can give the RecurrenceSet a go to make it fully compatible with the standards in RFC-5545
- 3 ans, 8 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : We can also probably get rid of get_next_suggested_date, since dateutil.rrule.rrulestr can generate it from string.
- 3 ans, 8 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) (3 replies) : Our RecurrentSet is rather straight-forward (feature poor). Looking at the RFC-5545, I think we should probably follow their standard. @luc any comment on this?
- 3 ans, 8 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : There are 'secondly', 'minutely' & 'hourly' frequencies in the RRULE RFC (5545) which we do not have in lino. I think we should also have them to make the calendar events compatible with iCalendar specs.
- 3 ans, 8 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : I am not sure whether we want multi-user contacts synchronization. In a first step it might be enough to say that the contacts of a site are synced with the Google contacts of a single site user account. The username of that account could be a plugin setting, e.g. google.contacts_sync_user.
- 3 ans, 8 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : Synching FROM Google TO a Lino calendar is not needed in a first step. Publishing a Lino calendar TO a Google calendar is more important. And in general the contacts are more important than the calendar. For contacts the sync in both directions would be a great thing.
- 3 ans, 8 mois ago by Luc Saffre in reply to Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : And it seems that also Nextcloud have problems with importing recurrent eventsfrom Google. (I read this in French).
- 3 ans, 8 mois ago by Luc Saffre in reply to Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : I guess we need to write our own parser...
- 3 ans, 8 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images))
- 3 ans, 8 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) (3 replies) : In the recurrent events from google, the RRULE(s) looks like the following: "RRULE:FREQ=MONTHLY;BYDAY=-1FR" , "RRULE:FREQ=YEARLY" and so on. the dateutil.rrule.rrulestr can resolve such rules into datetime(s). But I am not yet sure how to convert these rules into cal.RecurrentEvent fields.
- 3 ans, 10 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : I suppose we can get rid of the token refresh and revoka in the `google.utils.get_credentials` since social_django takes care of that, but I am not sure, we should probably keep them for just to be sure, a token might expire in between the time the user logs and runs some sync action.
- 3 ans, 10 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : python-social-auth only supports user authentication API from google. but the 'google.utils.get_credentials' works with the API keys for google peoples API, hence is necessary for syncing cal and contacts data.
- 3 ans, 10 mois ago by Sharif Mehedi about #2013 (Lino and the Google API (people, calendar, images)) : One key point is to note is that the `google plus` service had been [url plus.google.com/ shutdown], the API might still work but we should probably remove the google plus related settings from lino.core.auth.utils.activate_social_auth_testing and use the standard ones.
- 3 ans, 10 mois ago by Luc Saffre about #2013 (Lino and the Google API (people, calendar, images)) : @8lurry we should have a look at this together. IIRC the google plugin doesn't yet use psa (python-social-auth).