Skip to main content

Fugle Realtime API client library for Python

Project description

Fugle Realtime

PyPI version Python version Build Status

Fugle Realtime API client library for Python

Install

$ pip install fugle-realtime

Usage

The library a Python client that supports HTTP API and WebSocket.

HTTP API

from fugle_realtime import HttpClient

api_client = HttpClient(api_token='demo')

intraday.meta

api_client.intraday.meta(symbolId='2884')

intraday.quote

api_client.intraday.quote(symbolId='demo')

intraday.chart

api_client.intraday.chart(symbolId='demo')

intraday.dealts

api_client.intraday.chart(symbolId='demo', limit=50)

intraday.volumes

api_client.intraday.volumes(symbolId='demo')

Simple WebSocket Demo

import time
from fugle_realtime import WebSocketClient

def handle_message(message):
    print(message)

def main():
    ws_client = WebSocketClient(api_token='demo')
    ws = ws_client.intraday.quote(symbolId='2884', on_message=handle_message)
    ws.run_async()
    time.sleep(3)
    ws.close()

if __name__ == '__main__':
    main()

Reference

Fugle Realtime API

License

MIT

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

fugle-realtime-0.3.0.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

fugle_realtime-0.3.0-py3-none-any.whl (6.1 kB view hashes)

Uploaded 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