Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect with Google Contacts #36

Open
phildini opened this issue Jan 28, 2016 · 15 comments
Open

Connect with Google Contacts #36

phildini opened this issue Jan 28, 2016 · 15 comments

Comments

@phildini
Copy link
Owner

https://developers.google.com/google-apps/contacts/v3/?hl=en

@phildini
Copy link
Owner Author

@phildini
Copy link
Owner Author

@phildini
Copy link
Owner Author

@phildini
Copy link
Owner Author

So, digging into this, here are my findings so far:

  • the gdata library that I could use to access the contacts API doesn't support python 3
  • pyCardDav, the only python client library I could find for the CardDav API, also doesn't support python 3
  • django allauth doesn't have the correct scoping to get a good api key for accessing the contacts api over OAuth.

In other words, I'm going to have to science the crap out of this.

@paulproteus
Copy link
Collaborator

paulproteus commented Jan 30, 2016 via email

@phildini
Copy link
Owner Author

Lol, I'm actually referencing a line from the movie "The Martian".

What I think I'll really need to do is:

  • Write my own oauth integration
  • Write my own contacts api client library and/or carddav api client library

@paulproteus
Copy link
Collaborator

paulproteus commented Jan 30, 2016 via email

@phildini
Copy link
Owner Author

Here's one of them:
https://github.com/google/gdata-python-client

Here's the other one:
https://github.com/geier/pycarddav

I don't know if it's worth it to try to update them over re-writing them. pycarddav in particular is based on the vobject library, which is massive, hasn't been updated since like '09, and also doesn't support python3.

@paulproteus
Copy link
Collaborator

paulproteus commented Jan 30, 2016 via email

@phildini
Copy link
Owner Author

I'm also not sure that syncing over that API is the best approach. It would require doing "since time changed" queries, then comparing against what's in ContactOtter... which I guess is basically what CardDav is already doing? 😝

@phildini
Copy link
Owner Author

@paulproteus if you're interested in doing a hacking session this weekend to help me nail this out (and maybe work a bit more on #8) I'd be more interested. If I'm doing this on my own, I'll probably write a client that does just what I need.

@phildini
Copy link
Owner Author

The saga continues.

Dug more into the contacts API, found that it linked to https://developers.google.com/api-client-library/python/ for doing oauth, which isn't too bad, except that that library will only do the oauth portion, because the Contacts API doesn't support the service discovery API used by the python-api-client. Sigh.

Also came across this post: https://groups.google.com/forum/#!topic/oauth2-dev/unOUxP36Ag8, which indicates that the gdata library only supports oauth 1, but the contacts api only supports oauth2. Sigh.

@phildini
Copy link
Owner Author

Ok, more results: I got oauth working, and was able to pull a data set using requests. Hooray!

Time to learn some XML parsing, I guess.

@phildini
Copy link
Owner Author

https://github.com/tBaxter/python-card-me - python3 library with vcard support!

@phildini
Copy link
Owner Author

phildini commented Feb 1, 2016

lolololololololol: http://blog.fruux.com/2014/10/16/google-carddav/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants