Skip to main content

Python client for ModulBank REST API

Project description

https://travis-ci.org/Otetz/modulbank.svg?branch=master Documentation Status https://badge.fury.io/py/modulbank.svg https://coveralls.io/repos/github/Otetz/modulbank/badge.svg?branch=master Code Climate

Python client for ModulBank REST API

Installation

Install modulbank package from PyPi:

pip install modulbank

Getting started

Make sure to include this line in the beginning of your file:

from modulbank import *

Set your API Token and choose sandbox mode or off:

client = ModulbankClient(token=MODULBANK_TOKEN, sandbox_mode=True)

Make queries:

print([str(acc) for acc in client.accounts()])
print(client.balance('58c20343-5d3b-422c-b98b-a5ec037df782'))
print([str(op) for op in client.operations('58c20343-5d3b-422c-b98b-a5ec037df782')])

Or send payment order:

p = PaymentOrder(doc_num='994720', account_num='40802810670010011008', amount=Decimal(100.00), purpose='Для теста',
                 payer=Contractor(name='Индивидуальный предприниматель Александров Александр Александрович',
                                  inn='770400372208',
                                  bank=BankShort(account='40802810670010011008',
                                                 name='МОСКОВСКИЙ ФИЛИАЛ АО КБ \"МОДУЛЬБАНК\"',
                                                 bic='044525092', corr_acc='30101810645250000092')),
                 recipient=Contractor(name='МОСКОВСКИЙ ФИЛИАЛ АО КБ \"МОДУЛЬБАНК\"',
                                      inn='2204000595', kpp='771543001',
                                      bank=BankShort(account='30102810675250000092',
                                                     name='МОСКОВСКИЙ ФИЛИАЛ АО КБ \"МОДУЛЬБАНК\"',
                                                     bic='044525092', corr_acc='30102810675250000092')))
res = client.create_payment_draft(p)
assert len(res.errors) == 0
assert res.total_loaded == 1

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

modulbank-0.0.1.tar.gz (12.3 kB view hashes)

Uploaded Source

Built Distribution

modulbank-0.0.1-py2.py3-none-any.whl (14.9 kB view hashes)

Uploaded Python 2 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