Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Библиотека для работы с API Яндекс ID (OAuth) для Python 3.10+. Поддерживает асинхронную работу.
С помощью pip:
pip install yandexid
С помощью pip+git:
pip install https://github.com/LulzLoL231/yandexid.git
Из исходников:
git clone https://github.com/LulzLoL231/yandexid
pip install ./yandexid
Получение OAuth токена:
from yandexid import YandexOAuth
yandex_oauth = YandexOAuth(
client_id='<client_id>',
client_secret='<client_secret>',
redirect_uri='<redirect_uri>'
)
auth_url = yandex_oauth.get_authorization_url()
# Тут нужно перейти по ссылке auth_url и получить код авторизации
token = yandex_oauth.get_token_from_code('<code>')
Возвращает объект Token
с информацией о OAuth токене. Формат объекта совпадает с форматом ответа из API Яндекс ID.
Получение информации о пользователе:
from yandexid import YandexID
yandex_id = YandexID('<oauth_token>')
user_info = yandex_id.get_user_info_json()
Возвращает объект User
с информацией о пользователе. Формат объекта совпадает с форматом ответа из API Яндекс ID.
Чтобы использовать асинхронность, используйте классы AsyncYandexOAuth
и AsyncYandexID
:
from yandexid import AsyncYandexID
yandex_id = AsyncYandexID('<oauth_token>')
user_info = await yandex_id.get_user_info_json()
Название методов полностью совпадает с названием синхронных методов, не забывайте использовать await
перед вызовом асинхронных методов.
Логотипы Яндекс ID и название сервиса "Яндекс ID" принадлежат Яндексу.
FAQs
Yandex ID oauth API wrapper
We found that yandexid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.