# aioyoomoney
**aioyoomoney** — это асинхронная Python-библиотека для работы с [YooMoney API](https://yoomoney.ru/docs/wallet).
Позволяет получать информацию о счёте, просматривать историю операций, получать детали операций, создавать счета для оплаты и проверять их статус.
---
## 🔑 Получение Access Token
1. Войдите в свой кошелек YooMoney. Если кошелька ещё нет — [создайте](https://yoomoney.ru/).
2. Перейдите на [страницу регистрации приложения](https://yoomoney.ru/myservices/new).
3. Укажите параметры приложения:
- Скопируйте `CLIENT_ID`, `CLIENT_SECRET` и `REDIRECT_URI` — они понадобятся для авторизации.
4. Подтвердите регистрацию.
5. Выполните следующий код для получения токена:
```python
from aioyoomoney import authorize
token = authorize(
client_id="YOUR_CLIENT_ID",
redirect_uri="YOUR_REDIRECT_URI",
client_secret="YOUR_CLIENT_SECRET",
scope=[
"account-info",
"operation-history",
"operation-details",
"incoming-transfers",
"payment-p2p",
]
)
print(token)
После выполнения кода вы получите токен, который можно использовать для доступа к API. Это самый сложный шаг — дальше всё просто!
🚀 Возможности
- 🔐 Получение информации о счете
- 💳 История операций с фильтрами
- 🧾 Детали конкретной операции
- 🧨 Создание платёжной формы (инвойса)
- ✅ Проверка оплаты по метке (label)
📦 Установка
pip install aioyoomoney
Требования: Python 3.9+, aiohttp, pydantic, yarl
⚡ Быстрый старт
import asyncio
from aioyoomoney import YooMoney
async def main():
client = YooMoney(
token="your_yoomoney_token",
receiver="410011161616877" # ваш кошелек для приёма платежей
)
account = await client.account_info()
print(f"Баланс: {account.balance} ₽")
asyncio.run(main())
📘 Примеры
Получить информацию о счёте
account = await client.account_info()
print(account.balance, account.account)
Получить историю операций
history = await client.operation_history(records=10)
for op in history.operations:
print(op.amount, op.datetime, op.title)
Получить детали операции
details = await client.operation_details(operation_id="1234567890")
print(details.amount, details.message)
Создать форму оплаты (инвойс)
invoice = await client.create_invoice(
amount=500.0,
invoice_id="order_123",
redirect_url="https://example.com/success"
)
print(invoice.url_pay)
Проверка оплаты по invoice_id
is_paid = await client.check_invoice("order_123")
print("Оплачено!" if is_paid else "Ожидает оплату")
🧪 Тестирование
Для запуска тестов (в процессе написания):
pytest
🛠 Используемые технологии
📄 Лицензия
Проект распространяется под лицензией MIT.
👤 Автор
Разработано с ❤️ @belyankiss
Metadata
Release files for aioyoomoney 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aioyoomoney-0.1.0.tar.gz | 13.5 kB | Without provenance | Details for aioyoomoney-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aioyoomoney-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for aioyoomoney-0.1.0-py3-none-any.whl |
Total release size: 28.2 kB
Release files / aioyoomoney-0.1.0.tar.gz
| Download URL | aioyoomoney-0.1.0.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb7d61212acc184200a0425848fa34232563bb5d95918bac560ce6790b039ace
|
|
BLAKE2b-256 checksum How to use checksums |
08c4d560e3658de5309ad3faffc0391c68a949a4f29bd065dbff667caca008fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|
Release files / aioyoomoney-0.1.0-py3-none-any.whl
| Download URL | aioyoomoney-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
45fb5adcd586f6824505d0a3a39f0d80c8c40ce51fb24f2ae4e930748b9fee96
|
|
BLAKE2b-256 checksum How to use checksums |
6f482e8603e66ef29aca5fd3345779d1bd9b265d995529309a38afe868039576
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|
Security for aioyoomoney 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.