
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
Библиотека для работы с API Яндекс ID (OAuth) для Python 3.12+. Поддерживает асинхронную работу.
С помощью pip:
pip install yid-ng
Из исходников:
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 yaidng 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.