Async AAIO api wrapper for python
Project description
AAIO API for Python 3
About
This library is a wrapper for the https://aaio.so API from enthusiast. All methods are described and all types are explicitly defined. Methods that create requests to aaio.so return a pydantic's models for each response. Please write about all problems related to the library to issues
API is up-to-date as of 07 August 2024.
- PyPl - https://pypi.org/project/aaio/
- Github - https://github.com/kewldan/AAIO
- Docs - https://kewldan.ru/projects/aaio
- Demo - https://t.me/aaio_demo_bot
- Requirements: Python >= 3.7
- Added to AAIO SDKs
Features
- It's completely asynchronous
- You can use multiple clients to work with multiple users or shops
- All methods for working with API are implemented
- The library returns strictly typed for responses from APIs
- For each method, docstrings are used
- The library handle {type: error} responses and throws AAIOBadRequest exception
- Our library was the first to be added to the official AAIO wiki
- Modern, strict code for Python 3.7
Library Installation
- Install via pip:
pip install aaio
- Download sources -
git clone https://github.com/kewldan/AAIO
Getting Started
Get user balance
import asyncio
from aaio import AAIO
async def main():
client = AAIO('MERCHANT ID', 'SECRET KEY', 'API KEY')
balances = await client.get_balances()
print(balances) # type='success' code=None message=None balance=625.85 referral=172.96 hold=0.0
asyncio.run(main())
Create payment URL for customer
import asyncio
from aaio import AAIO
async def main():
client = AAIO('MERCHANT ID', 'SECRET KEY', 'API KEY')
# New way to create payments
payment_url = await client.get_pay_url(100, 'my_order_id', 'My order description', 'qiwi', 'support@aaio.so',
'referral code', currency='USD',
language='en')
print(payment_url['url']) # Prints payment url for customer
# DEPRECATED METHOD
payment_url = client.create_payment(100, 'my_order_id', 'My order description', 'qiwi', 'support@aaio.so',
'referral code', currency='USD',
language='en')
print(payment_url)
###################
asyncio.run(main())
Create payoff
import asyncio
from aaio import AAIO
async def main():
client = AAIO('MERCHANT ID', 'SECRET KEY', 'API KEY')
payoff = await client.create_payoff('qiwi', 100.35, '79998887766', 'my_payoff_id')
print(payoff.status) # in_progress
asyncio.run(main())
Contact
- E-Mail - kewldanil1@gmail.com
- Telegram - @kewldan
License
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
aaio-1.4.0.tar.gz
(87.0 kB
view details)
Built Distribution
aaio-1.4.0-py3-none-any.whl
(11.8 kB
view details)
File details
Details for the file aaio-1.4.0.tar.gz
.
File metadata
- Download URL: aaio-1.4.0.tar.gz
- Upload date:
- Size: 87.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8d4115a8221a10f65b2682c764466d250145c84f631e6b5481e4ff85a34485d |
|
MD5 | 1c66c399812f6a7c47cc09de07bf3fb2 |
|
BLAKE2b-256 | 5b5370fc06e4e88000342d984b6f09bcdbca94a971ea59e202d7b00040b9ccf6 |
File details
Details for the file aaio-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: aaio-1.4.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 719cec6738deaa1d4957f8d7e17d1360ba66ab0ff893d4133574f0cd1d698a63 |
|
MD5 | 668a2a173fd4c6f01892ef8cd2b897bd |
|
BLAKE2b-256 | 4f12401c86896d088497ffa1abf8c612a316e84b47c633cbb15ba4b9f1db20c6 |