Skip to content

Commit

Permalink
feat: update premium params
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkersner committed Oct 31, 2024
1 parent c467c37 commit c1b4b7d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion datamaxi/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.23.0"
__version__ = "0.24.0"
33 changes: 24 additions & 9 deletions datamaxi/datamaxi/premium.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ def __init__(self, api_key=None, **kwargs: Any):

def get(
self,
sort: str = None,
limit: int = None,
symbol: str = None,
sourceExchange: str = None,
targetExchange: str = None,
asset: str = None,
sourceQuote: str = None,
targetQuote: str = None,
currency: str = None,
sort: str = None,
limit: int = None,
pandas: bool = True,
) -> Union[List, pd.DataFrame]:
"""Fetch premium data
Expand All @@ -31,11 +34,14 @@ def get(
<https://docs.datamaxiplus.com/rest/premium/premium>
Args:
sort (str): Sort data by `asc` or `desc`
limit (int): Limit number of data to return
symbol (str): Symbol name
sourceExchange (str): Source exchange name
targetExchange (str): Target exchange name
asset (str): Asset name
sourceQuote (str): Source quote currency
targetQuote (str): Target quote currency
currency (str): Currency applied to cross-exchange price differences
sort (str): Sort data by `asc` or `desc`
limit (int): Limit number of data to return
pandas (bool): Return data as pandas DataFrame
Returns:
Expand All @@ -49,15 +55,24 @@ def get(
if limit is not None:
params["limit"] = limit

if symbol is not None:
params["symbol"] = symbol

if sourceExchange is not None:
params["sourceExchange"] = sourceExchange

if targetExchange is not None:
params["targetExchange"] = targetExchange

if asset is not None:
params["asset"] = asset

if sourceQuote is not None:
params["sourceQuote"] = sourceQuote

if targetQuote is not None:
params["targetQuote"] = targetQuote

if currency is not None:
params["currency"] = currency

res = self.query("/api/v1/premium", params)

if pandas:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[project]
name = "datamaxi"
version = "0.23.0"
version = "0.24.0"
authors = [
{ name="Bisonai", email="[email protected]" },
]
description = "Official Python client for DataMaxi+ API"
description = "Official Python SDK for DataMaxi+ API"
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
Expand Down

0 comments on commit c1b4b7d

Please sign in to comment.