GithubHelp home page GithubHelp logo

svathis / gcontacts2logseq Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 3.0 31 KB

One way sync of your Google Contacts to your logseq graph

Python 100.00%
api google google-contacts google-contacts-api google-people-api people python loqseq sync synchronization

gcontacts2logseq's Introduction

gContacts2logseq

One-way sync Google Contacts to logseq

A Python script that uses Google People API to generate a .md file to be consumed by logseq

Authentication

The first time you will run gContacts2logseq you will be asked to authorize this application to access your Google contacts.

gContacts2logseq will print a URL that you need to copy/paste it to your browser and follow the instrucions from there.

When, the authentication flow has completed, you may close this window.

Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=772680894138-om5gu5sbpjj8p2im9f6f1p30uc9u1j5l.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A33599%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcontacts.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuser.addresses.read&state=b2QYSUuv4Q0jmKjd4BzG2RCPe4Jmmg&code_challenge=dXmZdIenosQn7B2wgIt021LPKb77lNfSa1NSqRi_xsM&code_challenge_method=S256&access_type=offline

Periodically you may get the following error message when running gContacts2logseq:

('invalid_grant: Token has been expired or revoked.', {'error': 'invalid_grant', 'error_description': 'Token has been expired or revoked.'})

In this case you need delete the token.json file and rerun the authentication procedure, above.

gcontacts2logseq's People

Contributors

svathis avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gcontacts2logseq's Issues

The link in the README.md for authorizing the app does not work

Specifically, the error says:

Access blocked: gContacts2logseq has not completed the Google verification process

and then..

gContacts2logseq has not completed the Google verification process. The app is currently being tested, and can only be accessed by developer-approved testers. If you think you should have access, contact the developer.
If you are a developer of gContacts2logseq, see error details.
Error 403: access_denied

and when you click "error details" it shows:

Error 403: access_denied
Request details: access_type=offline response_type=code redirect_uri=http://localhost:33599/ state=b2QYSUuv4Q0jmKjd4BzG2RCPe4Jmmg code_challenge_method=S256 client_id=772680894138-om5gu5sbpjj8p2im9f6f1p30uc9u1j5l.apps.googleusercontent.com code_challenge=dXmZdIenosQn7B2wgIt021LPKb77lNfSa1NSqRi_xsM scope=https://www.googleapis.com/auth/contacts.readonly https://www.googleapis.com/auth/user.addresses.read

Generally, it is unclear if you intend for other users of this app to actually click this link, or if you are showing it as an example of what to click. If this is the url to click, then the ReadMe should just link to it directly.

Crashes due to missing credentials.json file

On the first out-of-the-box run of the script, it crashes because credentials.json is missing.

Specifically:

Fmbpro:gContacts2logseq ftrotter$ python gContacts2logseq.py
Traceback (most recent call last):
File "/Users/ftrotter/gitper/gContacts2logseq/gContacts2logseq.py", line 194, in
creds = login()
^^^^^^^
File "/Users/ftrotter/gitper/gContacts2logseq/gContacts2logseq.py", line 173, in login
flow = InstalledAppFlow.from_client_secrets_file(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/google_auth_oauthlib/flow.py", line 180, in from_client_secrets_file
with open(client_secrets_file, 'r') as json_file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'credentials.json'

Please improve Readme.md

It is not clear to me how to use this script.

Should I create an application with Google, and authenticate against that?
Should I be authenticating against the existing gContacts2logseq app? That seems wrong, since the whole point of logseq is not to give some random third party app access to your data.

I have opened several other bugs, and a pull request. But I suspect that with a better Readme would perhaps address the other issues.

If I may suggest. You might consider doing a quick Hallway Usability Test, with pretty much any programmer friend. Just ask them to get your script working. When they fail to do so immediately, note the reasons why and either improve the code or the Readme to address any issues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.