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='2884')

intraday.chart

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

intraday.dealts

api_client.intraday.dealts(symbolId='2884', limit=50)

intraday.volumes

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

historical.candles

api_client.historical.candles('2884', '2022-02-07', '2022-02-11', None)
api_client.historical.candles('2884', None, None, 'open,high,low,close,volume,turnover,change')

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.4.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fugle_realtime-0.4.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file fugle-realtime-0.4.0.tar.gz.

File metadata

  • Download URL: fugle-realtime-0.4.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.6.5 Darwin/21.2.0

File hashes

Hashes for fugle-realtime-0.4.0.tar.gz
Algorithm Hash digest
SHA256 fc61e115eace5fbef2d916409728f3f3cff122827a7c15adc4bebfe8986ecbb2
MD5 92062ad7c20cf1d1e21855dc5dcd904f
BLAKE2b-256 6f31bd8ccfe0a8eab7730f3b997c074a07932328cd45324a802d8b1afb9a5783

See more details on using hashes here.

File details

Details for the file fugle_realtime-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: fugle_realtime-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.6.5 Darwin/21.2.0

File hashes

Hashes for fugle_realtime-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8cd789c3c368969172f7da7e21f1d18d5b29c637a6c1b7cea7dd4694747a52e
MD5 269d70597f7e66da8bb1fabe5156e5cf
BLAKE2b-256 80ee70ec526a49a94bd7973157428f4fc3ea35ce4c0feeeb67f5e4ff97d0c6e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page