Fugle Realtime API 1.0 client library for Python
Project description
[![PyPI version][pypi-image]][pypi-url] [![Python version][python-image]][python-url] [![Build Status][action-image]][action-url]
Fugle MarketData
[![PyPI version][pypi-image]][pypi-url] [![Python version][python-image]][python-url] [![Build Status][action-image]][action-url]
Fugle MarketData API client library for Node.js
Installation
$ pip install fugle-marketdata
Importing
from fugle_marketdata import WebSocketClient, RestClient
Usage
The library is an isomorphic Python client that supports REST API and WebSocket.
REST API
# def main():
# client = RestClient(api_key=TOKEN)
# stock = client.stock
# print(stock.intraday.quote(symbol="2330"))
client = RestClient(api_key = 'YOUR_API_KEY')
stock = client.stock # Stock REST API client
print(stock.intraday.quote(symbol="2330"))
WebSocket API
from fugle_marketdata import WebSocketClient, RestClient
import asyncio
def handle_message(message):
print(message)
async def main():
client = WebSocketClient(api_key = 'YOUR_API_KEY')
stock = client.stock
stock.on("message", handle_message)
await stock.connect()
stock.subscribe({
"channel": 'trades',
"symbol": '2330'
})
if __name__ == "__main__":
asyncio.run(main())
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for fugle_marketdata-0.1.1a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f49319f10997362371821fade8917e8a10160b2bc4f4e174a882f55b307c623 |
|
MD5 | 7d3139f22e888096e0a3f1b0b6dd3d28 |
|
BLAKE2b-256 | 7bb8008ea245f4e1dc2572ade9187efd67b289dbb2f5360429c10e90d786d3ab |