Skip to main content

OST Kit API wrapper for Python

Project description

ost-kit-python

PyPI version

An unofficial OST Kit API wrapper for Python 2/3. Supports all functionality of OST Kit API v1.1.

Installation

pip install ost-kit-python

Usage

from ost_kit_python import OSTKit

# instantiate OST Kit with API credentials
ostkit = OSTKit(api_url='https://sandboxapi.ost.com/v1.1',
                api_key='OSTKIT_API_KEY',
                api_secret='OSTKIT_API_SECRET')

# execute API endpoint methods
r = ostkit.users.create('Jason')

# response JSON is automatically converted to a dictionary
user_id = r['data']['user']['id']

More Examples

# https://dev.ost.com/docs/api_users_create.html
r = ostkit.users.create(name='James')

# https://dev.ost.com/docs/api_users_edit.html
r = ostkit.users.update(user_id='abcd-1234-some-guid', name='Jimothy')

# https://dev.ost.com/docs/api_users_retrieve.html
r = ostkit.users.retrieve(user_id='abcd-1234-some-guid')

# https://dev.ost.com/docs/api_users_list.html
r = ostkit.users.list(limit=100)

# https://dev.ost.com/docs/api_airdrop_execute.html
r = ostkit.airdrops.execute(amount=6.66, user_ids=('abcd-1234-some-guid',))

# https://dev.ost.com/docs/api_airdrop_retrieve.html
r = ostkit.airdrops.retrieve(airdrop_id='abcd-1234-some-guid')

# https://dev.ost.com/docs/api_airdrop_list.html
r = ostkit.airdrops.list()

# https://dev.ost.com/docs/api_actions_create.html
r = ostkit.actions.create(name='Bonus',
                          kind='company_to_user',
                          amount=3.33,
                          arbitrary_amount='false')

# https://dev.ost.com/docs/api_actions_update.html
r = ostkit.actions.update(action_id=1234, name='MajorBonus')

# https://dev.ost.com/docs/api_actions_retrieve.html
r = ostkit.actions.retrieve(action_id=1234)

# https://dev.ost.com/docs/api_actions_list.html
r = ostkit.actions.list()

# https://dev.ost.com/docs/api_action_execute.html
r = ostkit.transactions.execute(from_user_id='abcd-1234-some-guid',
                                to_user_id='abcd-1234-some-guid',
                                action_id=1234)

# https://dev.ost.com/docs/api_transaction_retrieve.html
r = ostkit.transactions.retrieve(transaction_id='abcd-1234-some-guid')

# https://dev.ost.com/docs/api_transaction_list.html
r = ostkit.transactions.list()

# https://dev.ost.com/docs/api_balance.html
r = ostkit.balances.retrieve(user_id='abcd-1234-some-guid')

# https://dev.ost.com/docs/api_ledger.html
r = ostkit.ledger.retrieve(user_id='abcd-1234-some-guid')

# https://dev.ost.com/docs/api_transfers_create.html
r = ostkit.transfers.create(to_address='0x123456', amount=6.66)

# https://dev.ost.com/docs/api_transfers_retrieve.html
r = ostkit.transfers.retrieve(transfer_id='abcd-1234-some-guid')

# https://dev.ost.com/docs/api_transfers_list.html
r = ostkit.transfers.list()

# https://dev.ost.com/docs/api_token.html
r = ostkit.token.retrieve()

Project details


Download files

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

Files for ost-kit-python, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size ost_kit_python-0.0.4-py2-none-any.whl (4.3 kB) File type Wheel Python version py2 Upload date Hashes View hashes
Filename, size ost-kit-python-0.0.4.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page