Skip to content

Commit 009980d

Browse files
committed
feat: Added trading calendar interfaces
1 parent 03aaade commit 009980d

File tree

16 files changed

+176
-13
lines changed

16 files changed

+176
-13
lines changed

webull-python-sdk-core/webullsdkcore/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.1.4"
1+
__version__ = "0.1.5"
22

33
import logging
44

webull-python-sdk-demos/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
LONG_DESCRIPTION = fp.read()
1616

1717
requires = [
18-
"webull-python-sdk-mdata==0.1.4",
19-
"webull-python-sdk-trade==0.1.4"
18+
"webull-python-sdk-mdata==0.1.5",
19+
"webull-python-sdk-trade==0.1.5"
2020
]
2121

2222
setup_args = {
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2022 Webull
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import unittest
16+
17+
from webullsdkcore.client import ApiClient
18+
from webullsdkcore.exception.exceptions import ServerException
19+
from webullsdktrade.api import API
20+
from webullsdktrade.common.markets import Markets
21+
22+
optional_api_endpoint = "</optional_api_endpoint>"
23+
your_app_key = "</your_app_key>"
24+
your_app_secret = "</your_app_secret>"
25+
26+
# 'hk' or 'us'
27+
region_id = "<region_id>"
28+
api_client = ApiClient(your_app_key, your_app_secret, region_id)
29+
api_client.add_endpoint(region_id, optional_api_endpoint)
30+
31+
32+
class TestTradeCalendar(unittest.TestCase):
33+
34+
def test_trade_calendar(self):
35+
api = API(api_client)
36+
try:
37+
response = api.trade_calendar.get_trade_calendar(Markets.US.name, "2023-01-20", "2023-02-03")
38+
print(response.json())
39+
except ServerException as se:
40+
print(se)
41+
42+
try:
43+
response = api.trade_calendar.get_trade_calendar(Markets.HK.name, "2023-01-20", "2023-02-03")
44+
print(response.json())
45+
except ServerException as se:
46+
print(se)

webull-python-sdk-mdata/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
LONG_DESCRIPTION = fp.read()
1616

1717
requires = [
18-
"webull-python-sdk-core==0.1.4",
19-
"webull-python-sdk-quotes-core==0.1.4"
18+
"webull-python-sdk-core==0.1.5",
19+
"webull-python-sdk-quotes-core==0.1.5"
2020
]
2121

2222
setup_args = {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# coding=utf-8
22

3-
__version__ = '0.1.4'
3+
__version__ = '0.1.5'

webull-python-sdk-quotes-core/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"grpcio==1.51.1",
2525
"grpcio-tools==1.51.1",
2626
"protobuf==4.21.12",
27-
"webull-python-sdk-core==0.1.4"
27+
"webull-python-sdk-core==0.1.5"
2828
]
2929

3030
setup_args = {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.4"
1+
__version__ = "0.1.5"

webull-python-sdk-trade-events-core/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"grpcio==1.51.1",
2424
"grpcio-tools==1.51.1",
2525
"protobuf==4.21.12",
26-
"webull-python-sdk-core==0.1.4"
26+
"webull-python-sdk-core==0.1.5"
2727
]
2828

2929
setup_args = {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.4"
1+
__version__ = "0.1.5"

webull-python-sdk-trade/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
LONG_DESCRIPTION = fp.read()
1616

1717
requires = [
18-
"webull-python-sdk-trade-events-core==0.1.4",
19-
"webull-python-sdk-core==0.1.4"
18+
"webull-python-sdk-trade-events-core==0.1.5",
19+
"webull-python-sdk-core==0.1.5"
2020
]
2121

2222
setup_args = {

0 commit comments

Comments
 (0)