Эта страница доступна на русском языке: README_RU.md
The MooGold
library is a convenient tool for interacting with the MooGold service API. It supports both asynchronous and synchronous interaction with the API.
Install the library using pip:
git clone https://github.com/dzmuh97/pyMooGoldApi
cd pyMooGoldApi
pip install .
To use MooGoldAPI, you first need to get a partner_id
and secret
. Contact the MooGold manager through the contact details on the official website to obtain this information.
The full API documentation is available at: MooGold API Documentation.
import asyncio
from MooGold import MooGoldAPI
async def get_user_balance():
api = MooGoldAPI(moo_user_id="user_id", moo_partner_id="partner_id", moo_secret="secret")
balance = await api.balance()
print(balance)
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(get_user_balance())
from MooGold import SyncMooGoldAPI
def get_user_balance():
api = SyncMooGoldAPI(moo_user_id="user_id", moo_partner_id="partner_id", moo_secret="secret")
balance = api.balance()
print(balance)
if __name__ == '__main__':
get_user_balance()
In both examples, a model representing the user's balance will be displayed on the screen:
UserBalance(currency=USD, balance=194.35)