summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-fugle-realtime.spec365
-rw-r--r--sources1
3 files changed, 367 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..ae8c192 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/fugle-realtime-0.4.2.tar.gz
diff --git a/python-fugle-realtime.spec b/python-fugle-realtime.spec
new file mode 100644
index 0000000..304e185
--- /dev/null
+++ b/python-fugle-realtime.spec
@@ -0,0 +1,365 @@
+%global _empty_manifest_terminate_build 0
+Name: python-fugle-realtime
+Version: 0.4.2
+Release: 1
+Summary: Fugle Realtime API client library for Python
+License: MIT
+URL: https://github.com/fugle-dev/fugle-realtime-py#readme
+Source0: https://mirrors.aliyun.com/pypi/web/packages/57/ae/31d5acb88bf90c5ef5d2c5a0a444eedf4186d29261a5a8bbe8f736a73b89/fugle-realtime-0.4.2.tar.gz
+BuildArch: noarch
+
+Requires: python3-requests
+Requires: python3-websocket-client
+
+%description
+# 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
+
+
+%package -n python3-fugle-realtime
+Summary: Fugle Realtime API client library for Python
+Provides: python-fugle-realtime
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-fugle-realtime
+# 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
+
+
+%package help
+Summary: Development documents and examples for fugle-realtime
+Provides: python3-fugle-realtime-doc
+%description help
+# 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
+
+
+%prep
+%autosetup -n fugle-realtime-0.4.2
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-fugle-realtime -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.4.2-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..22d237a
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+8352d539baaa2034ae95d6a51a32ce1e fugle-realtime-0.4.2.tar.gz