fugle-realtime-0.4.2
توضیحات
Fugle Realtime API client library for Python
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | fugle-realtime-0.4.2 |
| نام | fugle-realtime |
| نسخه کتابخانه | 0.4.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Fortuna Intelligence Co., Ltd. |
| ایمیل نویسنده | development@fugle.tw |
| آدرس صفحه اصلی | https://github.com/fugle-dev/fugle-realtime-py#readme |
| آدرس اینترنتی | https://pypi.org/project/fugle-realtime/ |
| مجوز | MIT |
# Fugle Realtime
[![PyPI version][pypi-image]][pypi-url]
[![Python version][python-image]][python-url]
[![Build Status][action-image]][action-url]
> Fugle Realtime API client library for Python
## Install
```sh
$ pip install fugle-realtime
```
## Usage
The library a Python client that supports HTTP API and WebSocket.
### HTTP API
```py
from fugle_realtime import HttpClient
api_client = HttpClient(api_token='demo')
```
#### intraday.meta
```py
api_client.intraday.meta(symbolId='2884')
```
#### intraday.quote
```py
api_client.intraday.quote(symbolId='2884')
```
#### intraday.chart
```py
api_client.intraday.chart(symbolId='2884')
```
#### intraday.dealts
```py
api_client.intraday.dealts(symbolId='2884', limit=50)
```
#### intraday.volumes
```py
api_client.intraday.volumes(symbolId='2884')
```
#### historical.candles
```py
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
```py
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](https://developer.fugle.tw)
## License
[MIT](LICENSE)
[pypi-image]: https://img.shields.io/pypi/v/fugle-realtime
[pypi-url]: https://pypi.org/project/fugle-realtime
[python-image]: https://img.shields.io/pypi/pyversions/fugle-realtime
[python-url]: https://pypi.org/project/fugle-realtime
[action-image]: https://img.shields.io/github/actions/workflow/status/fugle-dev/fugle-realtime-python/pytest.yml?branch=master
[action-url]: https://github.com/fugle-dev/fugle-realtime-py/actions/workflows/pytest.yml
نیازمندی
| مقدار | نام |
|---|---|
| >=2.26.0,<3.0.0 | requests |
| >=1.2.1,<2.0.0 | websocket-client |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl fugle-realtime-0.4.2:
pip install fugle-realtime-0.4.2.whl
نصب پکیج tar.gz fugle-realtime-0.4.2:
pip install fugle-realtime-0.4.2.tar.gz