Yandex ID oauth API wrapper
Project description
Яндекс ID (OAuth) API
Библиотека для работы с API Яндекс ID (OAuth) для Python 3.10+. Поддерживает асинхронную работу.
Отличие от оригинального пакета
- Убраны жесткая фиксация версий что не давало использовать библиотеку в новых питонах (оставил лишь нижние границы).
Установка
-
С помощью pip:
pip install yandexid_new
-
С помощью pip+git:
pip install https://github.com/Miskler/YandexID-new.git
-
Из исходников:
git clone https://github.com/Miskler/YandexID-new.git pip install ./yandexid-new
Пример использования
-
Получение 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" принадлежат Яндексу.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yandexid_new-0.3.2.tar.gz.
File metadata
- Download URL: yandexid_new-0.3.2.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aef95255ac6835f263f9fb9850dd20db455f411bf2d0fed4d6ea3980d31647b0
|
|
| MD5 |
860cbae4306e1c51a5ea30960f7c8094
|
|
| BLAKE2b-256 |
470ce8075bc0d400970d9ae4a1410a9a2cd5ef1888e4a36340585198412f70a9
|
Provenance
The following attestation bundles were made for yandexid_new-0.3.2.tar.gz:
Publisher:
upload-to-pypi.yml on Miskler/YandexID-new
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yandexid_new-0.3.2.tar.gz -
Subject digest:
aef95255ac6835f263f9fb9850dd20db455f411bf2d0fed4d6ea3980d31647b0 - Sigstore transparency entry: 953147922
- Sigstore integration time:
-
Permalink:
Miskler/YandexID-new@f8bdaa14d0b300bc5a88c80bcc50a55af135fe9b -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Miskler
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
upload-to-pypi.yml@f8bdaa14d0b300bc5a88c80bcc50a55af135fe9b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file yandexid_new-0.3.2-py3-none-any.whl.
File metadata
- Download URL: yandexid_new-0.3.2-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfe955a006008aee7eedae9e1d71d37430820a803e7a987ce504faa0d0815aba
|
|
| MD5 |
9edfeee86a0d81d3349a8ade3a60df17
|
|
| BLAKE2b-256 |
ef583b131b5bb6546d8dd1344c8a16bbd7cb82df2e6d1ad0b9e3d62316d1cd63
|
Provenance
The following attestation bundles were made for yandexid_new-0.3.2-py3-none-any.whl:
Publisher:
upload-to-pypi.yml on Miskler/YandexID-new
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yandexid_new-0.3.2-py3-none-any.whl -
Subject digest:
cfe955a006008aee7eedae9e1d71d37430820a803e7a987ce504faa0d0815aba - Sigstore transparency entry: 953147996
- Sigstore integration time:
-
Permalink:
Miskler/YandexID-new@f8bdaa14d0b300bc5a88c80bcc50a55af135fe9b -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Miskler
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
upload-to-pypi.yml@f8bdaa14d0b300bc5a88c80bcc50a55af135fe9b -
Trigger Event:
workflow_dispatch
-
Statement type: