-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Version 1.1.6.12
- Loading branch information
Showing
4 changed files
with
86 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
import logging | ||
|
||
from upbit import pkg_version | ||
|
||
__all__ = ['client'] | ||
__module_name__ = 'upbit-client' | ||
|
||
__version__ = '1.1.6.12' | ||
__released_version__ = pkg_version.get_versions(__module_name__) | ||
__latest_version__ = __released_version__[0] | ||
|
||
|
||
if __latest_version__ != __version__: | ||
logging.basicConfig(format="[%(levelname)s] %(message)s") | ||
logging.warning( | ||
f"{__module_name__} is currently a newer version: " | ||
f"{__latest_version__}\n" | ||
f"Please update to the latest version using the pip command: " | ||
f"`pip install --upgrade {__module_name__}`" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
import jwt | ||
import hashlib | ||
import uuid | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
|
||
from bravado.requests_client import RequestsClient as rc | ||
from bravado.client import SwaggerClient as sc | ||
from upbit.authentication import APIKeyAuthenticator | ||
|
||
|
||
HOST = "https://api.upbit.com" | ||
SPEC_URI = "https://raw.githubusercontent.com/uJhin/upbit-client/main/mapper/swg_mapper.json" | ||
|
||
|
||
def Upbit(access_key: str = None, secret_key: str = None, **kwargs) -> sc: | ||
""" | ||
Upbit Client | ||
Please read the official Upbit Client document. | ||
Documents: https://ujhin.github.io/upbit-client-docs/ | ||
- Base URL: https://api.upbit.com | ||
- Base Path: /v1 | ||
- Upbit OPEN API Version: 1.1.6 | ||
- Author: ujhin | ||
- Email: [email protected] | ||
- GitHub: https://github.com/uJhin | ||
- Official OPEN API Documents: https://docs.upbit.com | ||
- Official Support Email: [email protected] | ||
""" | ||
|
||
arg_config = kwargs.get('config') | ||
arg_spec_uri = kwargs.get('spec_uri') | ||
config = { | ||
'also_return_response': False, | ||
'validate_responses': False, | ||
'use_models': False, | ||
'host': HOST | ||
} if not arg_config else arg_config | ||
spec_uri = SPEC_URI if not arg_spec_uri else arg_spec_uri | ||
|
||
if access_key and secret_key: | ||
|
||
request_client = rc() | ||
request_client.authenticator = APIKeyAuthenticator( | ||
config['host'], access_key, secret_key) | ||
|
||
client = sc.from_url( | ||
spec_url=spec_uri, http_client=request_client, config=config) | ||
|
||
else: | ||
|
||
client = sc.from_url(spec_url=spec_uri, config=config) | ||
|
||
client.__class__.__name__ = 'UpbitClient' | ||
return client | ||
|
||
|
||
from bravado.requests_client import RequestsClient as rc | ||
from bravado.client import SwaggerClient as sc | ||
from upbit.authentication import APIKeyAuthenticator | ||
|
||
|
||
HOST = "https://api.upbit.com" | ||
SPEC_URI = "https://raw.githubusercontent.com/uJhin/upbit-client/main/mapper/swg_mapper.json" | ||
|
||
|
||
def Upbit(access_key: str = None, secret_key: str = None, **kwargs) -> sc: | ||
""" | ||
Upbit Client | ||
Please read the official Upbit Client document. | ||
Documents: https://ujhin.github.io/upbit-client-docs/ | ||
- Base URL: https://api.upbit.com | ||
- Base Path: /v1 | ||
- Upbit OPEN API Version: 1.1.6 | ||
- Author: ujhin | ||
- Email: [email protected] | ||
- GitHub: https://github.com/uJhin | ||
- Official OPEN API Documents: https://docs.upbit.com | ||
- Official Support Email: [email protected] | ||
""" | ||
|
||
arg_config = kwargs.get('config') | ||
arg_spec_uri = kwargs.get('spec_uri') | ||
config = { | ||
'also_return_response': False, | ||
'validate_responses': False, | ||
'use_models': False, | ||
'host': HOST | ||
} if not arg_config else arg_config | ||
spec_uri = SPEC_URI if not arg_spec_uri else arg_spec_uri | ||
|
||
if access_key and secret_key: | ||
|
||
request_client = rc() | ||
request_client.authenticator = APIKeyAuthenticator( | ||
config['host'], access_key, secret_key) | ||
|
||
client = sc.from_url( | ||
spec_url=spec_uri, http_client=request_client, config=config) | ||
|
||
else: | ||
|
||
client = sc.from_url(spec_url=spec_uri, config=config) | ||
|
||
client.__class__.__name__ = 'UpbitClient' | ||
return client | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
import requests | ||
|
||
from distutils.version import LooseVersion | ||
|
||
|
||
def get_versions(package_name): | ||
url = f"https://pypi.org/pypi/{package_name}/json" | ||
resp = requests.get(url) | ||
data = resp.json() | ||
versions = data["releases"].keys() | ||
return sorted(versions, key=LooseVersion, reverse=True) |