Skip to content

Commit

Permalink
Update Version 1.1.6.15
Browse files Browse the repository at this point in the history
  • Loading branch information
uJhin committed Jan 15, 2021
1 parent 7ab2dc4 commit c966669
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/python-upbit-client.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@

from setuptools import setup
from setuptools import find_packages

import upbit


version = upbit.__version__
with open('README.rst') as readme:
long_description = readme.read()


setup(
name='upbit_client',
version='1.1.6.14',
version=version,
packages=find_packages(),
install_requires=[
'bravado>=11.0.2',
Expand All @@ -24,8 +29,7 @@
'upbit',
'upbit-client',
'Upbit-Client',
'Upbit_client',
'upbit'
'Upbit_client'
],
url='https://github.com/uJhin/upbit-client',
download_url='https://github.com/uJhin/upbit-client/releases',
Expand Down
3 changes: 2 additions & 1 deletion upbit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

from upbit import pkg_version


__all__ = ['client']
__module_name__ = 'upbit-client'

__version__ = '1.1.6.14'
__version__ = '1.1.6.15'
__released_version__ = pkg_version.get_versions(__module_name__)
__latest_version__ = __released_version__[0]

Expand Down
12 changes: 6 additions & 6 deletions upbit/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ def generate_query(self, params):
for k, v in params.items()
if k not in quotation_params
})
for param in quotation_params:
if params.get(param):
_param = params.pop(param)
params[f"{param}[]"] = _param
for q_param in quotation_params:
if params.get(q_param):
param = params.pop(q_param)
params[f"{q_param}[]"] = param
query_params = '&'.join([
f"{param}[]={_p}"
for _p in param
f"{q_param}[]={q}"
for q in q_param
])
query = f"{query}&{query_params}" if query else query_params
return query
18 changes: 18 additions & 0 deletions upbit/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

from bravado.requests_client import RequestsClient as rc
from bravado.client import SwaggerClient as sc
from bravado.http_future import HttpFuture as hf

from upbit.authentication import APIKeyAuthenticator


Expand Down Expand Up @@ -50,3 +52,19 @@ def Upbit(access_key: str = None, secret_key: str = None, **kwargs) -> sc:
client.__class__.__name__ = 'UpbitClient'
return client


def remaining_request(result: hf) -> dict:
"""
Check Request limit times
Please read the official Upbit Client document.
Documents: https://ujhin.github.io/upbit-client-docs/
"""

future = result.future
headers = future.result().headers
req = headers['Remaining-Req']
return {
k: v
for k, v in
[p.split('=') for p in req.split('; ')]
}

0 comments on commit c966669

Please sign in to comment.