Skip to main content

Яндекс ID (OAuth) API

Библиотека для работы с API Яндекс ID (OAuth) для Python 3.10+. Поддерживает асинхронную работу.

Документация API

Отличие от оригинального пакета

  1. Убраны жесткая фиксация версий что не давало использовать библиотеку в новых питонах (оставил лишь нижние границы).

Установка

  1. С помощью pip:

    pip install yandexid_new
    
  2. С помощью pip+git:

    pip install https://github.com/Miskler/YandexID-new.git
    
  3. Из исходников:

    git clone https://github.com/Miskler/YandexID-new.git
    pip install ./yandexid-new
    

Пример использования

  1. Получение 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.

  2. Получение информации о пользователе:

    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" принадлежат Яндексу.

Metadata

Release files for yandexid-new 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yandexid-new 0.3.2
File Size Uploaded
yandexid_new-0.3.2.tar.gz 9.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yandexid-new 0.3.2
File Interpreter ABI Platform
yandexid_new-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 25.7 kB

Release files / yandexid_new-0.3.2.tar.gz

Download URL yandexid_new-0.3.2.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
aef95255ac6835f263f9fb9850dd20db455f411bf2d0fed4d6ea3980d31647b0
BLAKE2b-256 checksum
How to use checksums
470ce8075bc0d400970d9ae4a1410a9a2cd5ef1888e4a36340585198412f70a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 14, 2026.

Transparency log

Release files / yandexid_new-0.3.2-py3-none-any.whl

Download URL yandexid_new-0.3.2-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfe955a006008aee7eedae9e1d71d37430820a803e7a987ce504faa0d0815aba
BLAKE2b-256 checksum
How to use checksums
ef583b131b5bb6546d8dd1344c8a16bbd7cb82df2e6d1ad0b9e3d62316d1cd63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page