Skip to content

Commit 13b7c93

Browse files
authored
Merge pull request #24 from uJhin/1.3.1
[Update] Update Version 1.3.1.0
2 parents 1085538 + 49c13b1 commit 13b7c93

File tree

8 files changed

+40
-40
lines changed

8 files changed

+40
-40
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
classifiers = [
2828
'Programming Language :: Python :: 3.8',
2929
'Programming Language :: Python :: 3.9',
30-
'Programming Language :: Python :: 3.10'
30+
'Programming Language :: Python :: 3.10',
3131
],
3232
keywords = [
3333
'Upbit',

upbit/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Please read the official Upbit Client document.
55
Documents: https://ujhin.github.io/upbit-client-docs/
66
7-
- Upbit OPEN API Version: 1.2.2
7+
- Upbit OPEN API Version: 1.3.1
88
- Author: ujhin
99
1010
- GitHub: https://github.com/uJhin
@@ -15,5 +15,5 @@
1515
from . import pkginfo
1616

1717

18-
__all__ = ['client', 'websocket']
18+
__all__ = [ "client", "websocket" ]
1919
__version__ = pkginfo.CURRENT_VERSION

upbit/authentication.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
class APIKeyAuthenticator(Authenticator):
1212

1313
MAPPER = "swg_mapper.json"
14-
QUERY_PARAMS = ("uuids", "txids", "identifiers", "states")
14+
QUERY_PARAMS = ( "uuids", "txids", "identifiers", "states" )
1515

1616

1717
def __init__(
1818
self,
19-
host: str,
19+
host : str,
2020
access_key: str,
2121
secret_key: str
2222
):

upbit/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Upbit:
1010
1111
- Base URL: https://api.upbit.com
1212
- Base Path: /v1
13-
- Upbit OPEN API Version: 1.2.2
13+
- Upbit OPEN API Version: 1.3.1
1414
- Author: ujhin
1515
1616
- GitHub: https://github.com/uJhin

upbit/models.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ def __init__(
2222
**kwargs
2323
):
2424

25-
arg_config = kwargs.get('config')
26-
arg_spec_uri = kwargs.get('spec_uri')
25+
arg_config = kwargs.get("config")
26+
arg_spec_uri = kwargs.get("spec_uri")
2727
config = {
28-
'also_return_response': False,
29-
'validate_responses': False,
30-
'use_models': False,
31-
'host': HOST
28+
"also_return_response": False,
29+
"validate_responses" : False,
30+
"use_models" : False,
31+
"host" : HOST
3232
} if not arg_config else arg_config
3333
spec_uri = SPEC_URI if not arg_spec_uri else arg_spec_uri
3434

3535
if access_key and secret_key:
3636

3737
request_client = RequestsClient()
3838
request_client.authenticator = APIKeyAuthenticator(
39-
host=config['host'],
39+
host=config["host"],
4040
access_key=access_key,
4141
secret_key=secret_key
4242
)
@@ -55,7 +55,7 @@ def __init__(
5555
)
5656

5757
@property
58-
def SWGClient(self):
58+
def SWGClient(self) -> SwaggerClient:
5959
return self.__client
6060

6161

upbit/pkginfo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Please read the official Upbit Client document.
55
Documents: https://ujhin.github.io/upbit-client-docs/
66
7-
- Upbit OPEN API Version: 1.2.2
7+
- Upbit OPEN API Version: 1.3.1
88
- Author: ujhin
99
1010
- GitHub: https://github.com/uJhin
@@ -28,8 +28,8 @@ def _get_versions(package_name):
2828

2929
PACKAGE_NAME = "upbit-client"
3030

31-
OPEN_API_VERSION = "1.2.2"
32-
CURRENT_VERSION = OPEN_API_VERSION+".4"
31+
OPEN_API_VERSION = "1.3.1"
32+
CURRENT_VERSION = OPEN_API_VERSION+".0"
3333

3434
RELEASED_VERSION = _get_versions(PACKAGE_NAME)
3535
LATEST_VERSION = RELEASED_VERSION[0]

upbit/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

2-
from typing import Union
2+
import typing as t
33

44

55
class HTTPFutureExtractor:
66

77
@staticmethod
8-
def remaining_request(headers: dict) -> dict:
8+
def remaining_request(headers: t.Dict[str, t.Any]) -> t.Dict[str, t.Any]:
99
"""
1010
Check Request limit times
1111
@@ -24,7 +24,7 @@ def remaining_request(headers: dict) -> dict:
2424
}
2525

2626
@staticmethod
27-
def future_extraction(http_future) -> dict:
27+
def future_extraction(http_future) -> t.Dict[str, t.Any]:
2828
resp = http_future.future.result()
2929
remaining = HTTPFutureExtractor.remaining_request(resp.headers)
3030

@@ -59,7 +59,7 @@ def future_extraction(http_future) -> dict:
5959
class Validator:
6060

6161
@staticmethod
62-
def validate_price(price: Union[int, float, str]) -> float:
62+
def validate_price(price: t.Union[int, float, str]) -> float:
6363
"""
6464
Please read the official Upbit Client document.
6565
Documents: https://ujhin.github.io/upbit-client-docs/

upbit/websocket.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import uuid
44
import json
55

6-
from typing import Union, List
6+
import typing as t
77

88

99
class UpbitWebSocket:
@@ -21,15 +21,15 @@ class UpbitWebSocket:
2121
"""
2222

2323
WEBSOCKET_URI = "wss://api.upbit.com/websocket/v1"
24-
FIELD_TYPES = ("ticker", "trade", "orderbook")
25-
FIELD_FORMATS = ("SIMPLE", "DEFAULT")
24+
FIELD_TYPES = ( "ticker", "trade", "orderbook" )
25+
FIELD_FORMATS = ( "SIMPLE", "DEFAULT" )
2626

2727

2828
def __init__(
2929
self,
30-
uri: Union[str] = None,
31-
ping_interval: Union[int, float] = None,
32-
ping_timeout: Union[int, float] = None
30+
uri : str = None,
31+
ping_interval: t.Union[int, float] = None,
32+
ping_timeout : t.Union[int, float] = None
3333
):
3434

3535
self.__uri = uri if uri else UpbitWebSocket.WEBSOCKET_URI
@@ -59,8 +59,8 @@ def Connection(self, conn):
5959

6060
def connect(
6161
self,
62-
ping_interval: Union[int, float] = None,
63-
ping_timeout: Union[int, float] = None
62+
ping_interval: t.Union[int, float] = None,
63+
ping_timeout : t.Union[int, float] = None
6464
):
6565
"""
6666
:param ping_interval: ping 간격 제한
@@ -90,9 +90,9 @@ async def ping(self, decode: str = "utf8"):
9090

9191
@staticmethod
9292
def generate_orderbook_codes(
93-
currencies: Union[List[str]],
94-
counts: Union[List[int]] = None
95-
) -> List[str]:
93+
currencies: t.List[str],
94+
counts : t.List[int] = None
95+
) -> t.List[str]:
9696
"""
9797
:param currencies: 수신할 `orderbook` field 마켓 코드 리스트
9898
:type currencies: list[str, ...]
@@ -111,11 +111,11 @@ def generate_orderbook_codes(
111111

112112
@staticmethod
113113
def generate_type_field(
114-
type: str,
115-
codes: Union[List[str]],
114+
type : str,
115+
codes : t.List[str],
116116
isOnlySnapshot: bool = None,
117117
isOnlyRealtime: bool = None,
118-
) -> dict:
118+
) -> t.Dict[str, t.Any]:
119119
"""
120120
:param type: 수신할 시세 타입 (현재가: `ticker`, 체결: `trade`, 호가: `orderbook`)
121121
:type type: str
@@ -151,9 +151,9 @@ def generate_type_field(
151151

152152
@staticmethod
153153
def generate_payload(
154-
type_fields: Union[List[dict]],
155-
ticket: str = None,
156-
format: str = 'DEFAULT'
154+
type_fields: t.List[t.Dict[str, t.Any]],
155+
ticket : str = None,
156+
format : str = "DEFAULT"
157157
) -> str:
158158
"""
159159
:param type_fields: Type Fields
@@ -169,13 +169,13 @@ def generate_payload(
169169
payload = []
170170

171171
ticket = ticket if ticket else str(uuid.uuid4())
172-
payload.append({"ticket": ticket})
172+
payload.append( { "ticket": ticket } )
173173

174174
payload.extend(type_fields)
175175

176176
fmt = format.upper()
177177
fmt = fmt if fmt in UpbitWebSocket.FIELD_FORMATS else "DEFAULT"
178-
payload.append({"format": fmt})
178+
payload.append( { "format": fmt } )
179179

180180
return json.dumps(payload)
181181

0 commit comments

Comments
 (0)