A Python library to connect with Brave New Coin APIs.
Supported APIs:
pip install git+https://github.com/pgrangeiro/python-bravenewcoin-client.git
tox
>>> from brave.clients import SpotPriceClient
>>> client = SpotPriceClient('customer', ('BraveNewCoin-API-Key', 'Token'))
Return the latest quote for crypto coin.
Parameters:
- Ticker: The crypto coin ticker. Type: String.
- Currency[optional]: The crypto coin value converted to currency. Type: String. Default: USD.
>>> from brave.clients import SpotPriceClient
>>> client = SpotPriceClient('customer', ('BraveNewCoin-API-Key', 'Token'))
>>> client.get('btc')
{'success': True, 'source': 'BraveNewCoin', 'time_stamp': 1523066461, 'utc...
Return the historic exchange data for crypto coin.
Parameters:
- Ticker: The crypto coin ticker. Type: String.
- Start Date[optional]: Get historic data from start date. Type: Datetime. Default: Today.
- End Date[optional]: Get historic data until end date. Type: Datetime. Default: Today.
- Currency[optional]: The crypto coin value converted to currency. Type: String. Default: USD.
>>> from brave.clients import ExchangeClient
>>> client = ExchangeClient('customer', ('BraveNewCoin-API-Key', 'Token'))
>>> client.get('btc')
{'success': True, 'source': 'BraveNewCoin', 'time_stamp': 1523066820, 'utc...
Return the market capitalization data for all crypto coins tracked by Brave New Coin.
Parameters:
- Days[optional]: Get market cap data for a number of days. Type: Integer. Default: 1.
>>> from brave.clients import MarketClient
>>> client = MarketClient('customer', ('BraveNewCoin-API-Key', 'Token'))
>>> client.get()
{'success': True, 'source': 'BraveNewCoin', 'endpoint': 'market-table', 'r...
You can create your own parser with your parse class method.
from brave.clients import SpotClient
class MyParser:
@classmethod
def parse(cls, data):
return {
'ticker': data['coin_id'],
'last_value': data['last_price'],
}
client = SpotPriceClient('customer', ('BraveNewCoin-API-Key', 'Token'), MyParser)