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
fugle_marketdata-1.0.0.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for fugle_marketdata-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe82e77c7169b400660d4182601bf3abdc7d8a99598ef51646f4c8875b4b2e6b |
|
MD5 | 060f0ba9aa2d7fe4a605ee470579f8fb |
|
BLAKE2b-256 | 71f9dab5f5f261c9ddccc6631e83efd9832faa022a91c63e2add77020658b18c |