2022-06-05 14:37:23 +03:00
|
|
|
|
## Установка
|
|
|
|
|
|
|
|
|
|
### 1. Настраиваем OAuth авторизацию Google
|
|
|
|
|
|
|
|
|
|
#### 1.1 Создаем или выбираем проект в Google Console
|
|
|
|
|
|
|
|
|
|
https://console.cloud.google.com/
|
|
|
|
|
|
|
|
|
|
#### 1.2 Включаем People API
|
|
|
|
|
|
|
|
|
|
API and Services → Library → Search and Enable the service
|
|
|
|
|
|
|
|
|
|
People API
|
|
|
|
|
|
|
|
|
|
#### 1.3 Создаем OAuth2 Screen Consent
|
|
|
|
|
|
|
|
|
|
API and Services → OAuth Consent Screen
|
|
|
|
|
|
|
|
|
|
В разделе Scopes выбираем People API
|
|
|
|
|
|
|
|
|
|
В разделе Test users добавляем наш адрес электронной почты
|
|
|
|
|
|
|
|
|
|
#### 1.4 Создаем Oauth2 Credentials
|
|
|
|
|
|
|
|
|
|
API and Services → Credentials → Create credentials → OAuth client ID
|
|
|
|
|
|
|
|
|
|
Application type: `Web application`
|
|
|
|
|
|
|
|
|
|
Authorized redirect URI: `http://localhost:42047/`
|
|
|
|
|
|
|
|
|
|
Сохраняем OAuth2 Credentials как json в рабочую папку с названием `credentials.json`.
|
|
|
|
|
|
|
|
|
|
### 2. Устанавливаем зависимости и запускаем скрипт
|
|
|
|
|
|
2022-06-05 14:22:11 +03:00
|
|
|
|
```shell
|
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
python main.py
|
|
|
|
|
```
|