Skip to main content

Sync/Async version monobank api

Project description

Mbnk


PyPI

Sync/Async Python3 Monobank API

Introduction

mbnk - python lib for:

• Monobank Open API
official docs: https://api.monobank.ua/docs/
lib docs: https://github.com/yeghorkikhai/mbnk/blob/master/docs/monobank_open_api.md
• Monobank Open API for providers
official docs: https://api.monobank.ua/docs/corporate.html
lib docs: https://github.com/yeghorkikhai/mbnk/blob/master/docs/monobank_corp_open_api.md
• MonoPay - Monobank Acquiring
official docs: https://api.monobank.ua/docs/acquiring.html
lib docs: https://github.com/yeghorkikhai/mbnk/blob/master/docs/monopay_api.md

Github

https://github.com/yeghorkikhai/mbnk

Installation

pip install mbnk

Getting Started Monobank Open API

# Sync Version Monobank API
import os
from mbnk import Monobank

# Your Monobank API token 
api_token = os.getenv('<X-Token>')

mbnk = Monobank(api_token=api_token)

#Get currencies rates list
currencies_list = mbnk.public.currency_rates()

# Async Version Monobank API
import os
import asyncio
from mbnk.asyncio import AsyncMonobank

# Your Monobank API token 
api_token = os.getenv('<X-Token>')


async def main():
    async_mbnk = AsyncMonobank(api_token=api_token)
    
    currencies_list = await mbnk.public.currency_rates()

    
if __name__ == "__main__":
    asyncio.run(main())
#Get Client Info
client_info = mbnk.personal.info()

#Setup webhook url
WEB_HOOK_URL = 'https://example.com/webhook/endpoint'
mbnk.personal.set_webhook(web_hook_url=WEB_HOOK_URL)

#Get statement
from_timestamp = (datetime.now() + timedelta(days=-31)).timestamp()
statement = mbnk.personal.statement(from_date=int(from_timestamp))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mbnk-0.1.2.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

mbnk-0.1.2-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page