Google OAuth2 implementation in Python is packaged in such a way that I have to
from google.oauth2 import service_account
credentials = service_account.Credentials...
Since I prefer to be explicit with the place my external methods come from, I would prefer very much to
import google.oauth2
credentials = google.oauth2.service_account.Credentials...
but this does not work, an answer to another question neatly explains why (there are also many other good explantions, more or less ion-depth).
Is there a way to mimic the "full path notation" so that I can use the second version, with the restrictions forcing me to use from module import ...
?
I tried
from google.oauth2 import service_account as google.oauth2.service_account
credentials = google.oauth2.service_account.Credentials....
but I get
File "d:\Nextcloud\dev-perso\testing\googlecalendar\googlecalendar.py", line 4
from google.oauth2 import service_account as google.oauth2.service_account
^
SyntaxError: invalid syntax
Is there another solution, or am I stuck with the short names?
Note: I could
from google.oauth2 import service_account as google_oauth2_service_account
credentials = google_oauth2_service_account.Credentials...
but this is not that elegant (which is a subjective opinion, and which I will end up using if there are no better solutions)