diff --git a/datamaxi/__init__.py b/datamaxi/__init__.py index 94e0e93..794be65 100644 --- a/datamaxi/__init__.py +++ b/datamaxi/__init__.py @@ -1,4 +1,4 @@ -from datamaxi.datamaxi import Datamaxi # noqa: F401 +from datamaxi.resources import Datamaxi # noqa: F401 from datamaxi.telegram import Telegram # noqa: F401 from datamaxi.naver import Naver # noqa: F401 from datamaxi.lib.constants import ( # noqa: F401 diff --git a/datamaxi/datamaxi/__init__.py b/datamaxi/resources/__init__.py similarity index 64% rename from datamaxi/datamaxi/__init__.py rename to datamaxi/resources/__init__.py index d202c39..cc5ad21 100644 --- a/datamaxi/datamaxi/__init__.py +++ b/datamaxi/resources/__init__.py @@ -1,31 +1,31 @@ from typing import Any from datamaxi.api import API from datamaxi.lib.constants import BASE_URL -from datamaxi.datamaxi.cex import Cex -from datamaxi.datamaxi.funding_rate import FundingRate -from datamaxi.datamaxi.forex import Forex -from datamaxi.datamaxi.premium import Premium -from datamaxi.datamaxi.liquidation import Liquidation -from datamaxi.datamaxi.open_interest import OpenInterest -from datamaxi.datamaxi.margin_borrow import MarginBorrow -from datamaxi.datamaxi.index_price import IndexPrice -from datamaxi.datamaxi.cex_candle import CexCandle # used in documentation # noqa:F401 -from datamaxi.datamaxi.cex_ticker import ( # used in documentation # noqa:F401 +from datamaxi.resources.cex import Cex +from datamaxi.resources.funding_rate import FundingRate +from datamaxi.resources.forex import Forex +from datamaxi.resources.premium import Premium +from datamaxi.resources.liquidation import Liquidation +from datamaxi.resources.open_interest import OpenInterest +from datamaxi.resources.margin_borrow import MarginBorrow +from datamaxi.resources.index_price import IndexPrice +from datamaxi.resources.cex_candle import CexCandle # used in documentation # noqa:F401 +from datamaxi.resources.cex_ticker import ( # used in documentation # noqa:F401 CexTicker, ) -from datamaxi.datamaxi.cex_fee import ( # used in documentation # noqa:F401 +from datamaxi.resources.cex_fee import ( # used in documentation # noqa:F401 CexFee, ) -from datamaxi.datamaxi.cex_wallet_status import ( # used in documentation # noqa:F401 +from datamaxi.resources.cex_wallet_status import ( # used in documentation # noqa:F401 CexWalletStatus, ) -from datamaxi.datamaxi.cex_announcement import ( # used in documentation # noqa:F401 +from datamaxi.resources.cex_announcement import ( # used in documentation # noqa:F401 CexAnnouncement, ) -from datamaxi.datamaxi.cex_token import ( # used in documentation # noqa:F401 +from datamaxi.resources.cex_token import ( # used in documentation # noqa:F401 CexToken, ) -from datamaxi.datamaxi.cex_symbol import ( # used in documentation # noqa:F401 +from datamaxi.resources.cex_symbol import ( # used in documentation # noqa:F401 CexSymbol, ) diff --git a/datamaxi/datamaxi/cex.py b/datamaxi/resources/cex.py similarity index 73% rename from datamaxi/datamaxi/cex.py rename to datamaxi/resources/cex.py index 05a7890..2ff8b9a 100644 --- a/datamaxi/datamaxi/cex.py +++ b/datamaxi/resources/cex.py @@ -1,12 +1,12 @@ from typing import Any from datamaxi.api import Resource -from datamaxi.datamaxi.cex_candle import CexCandle -from datamaxi.datamaxi.cex_ticker import CexTicker -from datamaxi.datamaxi.cex_fee import CexFee -from datamaxi.datamaxi.cex_wallet_status import CexWalletStatus -from datamaxi.datamaxi.cex_announcement import CexAnnouncement -from datamaxi.datamaxi.cex_token import CexToken -from datamaxi.datamaxi.cex_symbol import CexSymbol +from datamaxi.resources.cex_candle import CexCandle +from datamaxi.resources.cex_ticker import CexTicker +from datamaxi.resources.cex_fee import CexFee +from datamaxi.resources.cex_wallet_status import CexWalletStatus +from datamaxi.resources.cex_announcement import CexAnnouncement +from datamaxi.resources.cex_token import CexToken +from datamaxi.resources.cex_symbol import CexSymbol class Cex(Resource): diff --git a/datamaxi/datamaxi/cex_announcement.py b/datamaxi/resources/cex_announcement.py similarity index 100% rename from datamaxi/datamaxi/cex_announcement.py rename to datamaxi/resources/cex_announcement.py diff --git a/datamaxi/datamaxi/cex_candle.py b/datamaxi/resources/cex_candle.py similarity index 98% rename from datamaxi/datamaxi/cex_candle.py rename to datamaxi/resources/cex_candle.py index f3863d3..300412c 100644 --- a/datamaxi/datamaxi/cex_candle.py +++ b/datamaxi/resources/cex_candle.py @@ -3,7 +3,7 @@ from datamaxi.api import Resource from datamaxi.lib.utils import check_required_parameter from datamaxi.lib.utils import check_required_parameters -from datamaxi.datamaxi.utils import convert_data_to_data_frame +from datamaxi.resources.utils import convert_data_to_data_frame from datamaxi.lib.constants import SPOT, FUTURES, INTERVAL_1D, USD, Market, Interval diff --git a/datamaxi/datamaxi/cex_fee.py b/datamaxi/resources/cex_fee.py similarity index 100% rename from datamaxi/datamaxi/cex_fee.py rename to datamaxi/resources/cex_fee.py diff --git a/datamaxi/datamaxi/cex_symbol.py b/datamaxi/resources/cex_symbol.py similarity index 100% rename from datamaxi/datamaxi/cex_symbol.py rename to datamaxi/resources/cex_symbol.py diff --git a/datamaxi/datamaxi/cex_ticker.py b/datamaxi/resources/cex_ticker.py similarity index 100% rename from datamaxi/datamaxi/cex_ticker.py rename to datamaxi/resources/cex_ticker.py diff --git a/datamaxi/datamaxi/cex_token.py b/datamaxi/resources/cex_token.py similarity index 100% rename from datamaxi/datamaxi/cex_token.py rename to datamaxi/resources/cex_token.py diff --git a/datamaxi/datamaxi/cex_wallet_status.py b/datamaxi/resources/cex_wallet_status.py similarity index 100% rename from datamaxi/datamaxi/cex_wallet_status.py rename to datamaxi/resources/cex_wallet_status.py diff --git a/datamaxi/datamaxi/forex.py b/datamaxi/resources/forex.py similarity index 100% rename from datamaxi/datamaxi/forex.py rename to datamaxi/resources/forex.py diff --git a/datamaxi/datamaxi/funding_rate.py b/datamaxi/resources/funding_rate.py similarity index 98% rename from datamaxi/datamaxi/funding_rate.py rename to datamaxi/resources/funding_rate.py index bdc1ac4..a795c43 100644 --- a/datamaxi/datamaxi/funding_rate.py +++ b/datamaxi/resources/funding_rate.py @@ -3,7 +3,7 @@ from datamaxi.api import Resource from datamaxi.lib.utils import check_required_parameter from datamaxi.lib.utils import check_required_parameters -from datamaxi.datamaxi.utils import convert_data_to_data_frame +from datamaxi.resources.utils import convert_data_to_data_frame from datamaxi.lib.constants import ASC, DESC, SortOrder diff --git a/datamaxi/datamaxi/index_price.py b/datamaxi/resources/index_price.py similarity index 100% rename from datamaxi/datamaxi/index_price.py rename to datamaxi/resources/index_price.py diff --git a/datamaxi/datamaxi/liquidation.py b/datamaxi/resources/liquidation.py similarity index 100% rename from datamaxi/datamaxi/liquidation.py rename to datamaxi/resources/liquidation.py diff --git a/datamaxi/datamaxi/margin_borrow.py b/datamaxi/resources/margin_borrow.py similarity index 100% rename from datamaxi/datamaxi/margin_borrow.py rename to datamaxi/resources/margin_borrow.py diff --git a/datamaxi/datamaxi/open_interest.py b/datamaxi/resources/open_interest.py similarity index 100% rename from datamaxi/datamaxi/open_interest.py rename to datamaxi/resources/open_interest.py diff --git a/datamaxi/datamaxi/premium.py b/datamaxi/resources/premium.py similarity index 100% rename from datamaxi/datamaxi/premium.py rename to datamaxi/resources/premium.py diff --git a/datamaxi/datamaxi/utils.py b/datamaxi/resources/utils.py similarity index 100% rename from datamaxi/datamaxi/utils.py rename to datamaxi/resources/utils.py diff --git a/docs/cex-announcement.md b/docs/cex-announcement.md index c954695..ec18e2e 100644 --- a/docs/cex-announcement.md +++ b/docs/cex-announcement.md @@ -24,7 +24,7 @@ more_data, _ = next_request() - Pagination returns a `next_request` function for the next page. -::: datamaxi.datamaxi.CexAnnouncement +::: datamaxi.resources.CexAnnouncement options: show_submodules: true show_source: false diff --git a/docs/cex-candle.md b/docs/cex-candle.md index 2322843..50192ba 100644 --- a/docs/cex-candle.md +++ b/docs/cex-candle.md @@ -28,7 +28,7 @@ df = maxi.cex.candle( - `from_unix` and `to_unix` use Unix timestamps in seconds. - Set `pandas=False` to return the raw dict response. -::: datamaxi.datamaxi.CexCandle +::: datamaxi.resources.CexCandle options: show_submodules: true show_source: false diff --git a/docs/cex-fee.md b/docs/cex-fee.md index bbe6728..b5f7f96 100644 --- a/docs/cex-fee.md +++ b/docs/cex-fee.md @@ -19,7 +19,7 @@ fees = maxi.cex.fee(exchange="binance", symbol="BTC-USDT") - You can omit `symbol` to get all symbols for the exchange. -::: datamaxi.datamaxi.CexFee +::: datamaxi.resources.CexFee options: show_submodules: true show_source: false diff --git a/docs/cex-symbol.md b/docs/cex-symbol.md index 2a735e0..beb6019 100644 --- a/docs/cex-symbol.md +++ b/docs/cex-symbol.md @@ -39,7 +39,7 @@ liquidation = maxi.cex.symbol.liquidation(base="BTC", window="24h") - `metadata`, `tags`, `cautions`, and `delistings` take optional `exchange` / `base` filters; omit both to fetch across all symbols. - `oi_stats` accepts `currency` of `USD` or `KRW`. -::: datamaxi.datamaxi.CexSymbol +::: datamaxi.resources.CexSymbol options: show_submodules: true show_source: false diff --git a/docs/cex-ticker.md b/docs/cex-ticker.md index 6a38042..9c85fd4 100644 --- a/docs/cex-ticker.md +++ b/docs/cex-ticker.md @@ -25,7 +25,7 @@ ticker = maxi.cex.ticker.get( - Use `conversion_base` when you need cross-currency conversions. - Set `pandas=False` to return the raw dict response. -::: datamaxi.datamaxi.CexTicker +::: datamaxi.resources.CexTicker options: show_submodules: true show_source: false diff --git a/docs/cex-token.md b/docs/cex-token.md index 1893105..6b5dc05 100644 --- a/docs/cex-token.md +++ b/docs/cex-token.md @@ -23,7 +23,7 @@ more_data, _ = next_request() - Use `type="listed"` or `type="delisted"` to filter update types. -::: datamaxi.datamaxi.CexToken +::: datamaxi.resources.CexToken options: show_submodules: true show_source: false diff --git a/docs/cex-wallet-status.md b/docs/cex-wallet-status.md index 4b83eee..8fde333 100644 --- a/docs/cex-wallet-status.md +++ b/docs/cex-wallet-status.md @@ -19,7 +19,7 @@ status = maxi.cex.wallet_status(exchange="binance", asset="BTC") - Set `pandas=False` to return the raw dict response. -::: datamaxi.datamaxi.CexWalletStatus +::: datamaxi.resources.CexWalletStatus options: show_submodules: true show_source: false diff --git a/docs/forex.md b/docs/forex.md index 06b6eed..b0602cb 100644 --- a/docs/forex.md +++ b/docs/forex.md @@ -17,7 +17,7 @@ data = maxi.forex(symbol="USD-KRW") - Set `pandas=False` to return the raw dict response. -::: datamaxi.datamaxi.Forex +::: datamaxi.resources.Forex options: show_submodules: true show_source: false diff --git a/docs/funding-rate.md b/docs/funding-rate.md index 9ca1582..fc4b027 100644 --- a/docs/funding-rate.md +++ b/docs/funding-rate.md @@ -28,7 +28,7 @@ latest = maxi.funding_rate.latest(exchange="binance", symbol="BTC-USDT") - Pagination returns a `next_request` function for the next page. - Set `pandas=False` to return the raw dict response. -::: datamaxi.datamaxi.FundingRate +::: datamaxi.resources.FundingRate options: show_submodules: true show_source: false diff --git a/docs/index-price.md b/docs/index-price.md index 6221af2..b3a711d 100644 --- a/docs/index-price.md +++ b/docs/index-price.md @@ -22,7 +22,7 @@ data = maxi.index_price( - `from_` is spelled with a trailing underscore because `from` is a Python keyword; the wire-level query param remains `from`. -::: datamaxi.datamaxi.IndexPrice +::: datamaxi.resources.IndexPrice options: show_submodules: true show_source: false diff --git a/docs/liquidation.md b/docs/liquidation.md index 023a8c9..dbed476 100644 --- a/docs/liquidation.md +++ b/docs/liquidation.md @@ -39,7 +39,7 @@ history = maxi.liquidation.symbol_history( - `heatmap` and `stats` accept `window` of `1h`, `4h`, or `24h`; `heatmap`'s `topN` must be between 1 and 30. - `symbol_history` accepts `interval` of `5m`, `15m`, or `1h` and `window` of `24h`, `72h`, or `7d`. -::: datamaxi.datamaxi.Liquidation +::: datamaxi.resources.Liquidation options: show_submodules: true show_source: false diff --git a/docs/margin-borrow.md b/docs/margin-borrow.md index 8732a0f..3f59432 100644 --- a/docs/margin-borrow.md +++ b/docs/margin-borrow.md @@ -12,7 +12,7 @@ maxi = Datamaxi(api_key="YOUR_API_KEY") data = maxi.margin_borrow(asset="BTC") ``` -::: datamaxi.datamaxi.MarginBorrow +::: datamaxi.resources.MarginBorrow options: show_submodules: true show_source: false diff --git a/docs/open-interest.md b/docs/open-interest.md index 0a8d253..00d659e 100644 --- a/docs/open-interest.md +++ b/docs/open-interest.md @@ -38,7 +38,7 @@ history = maxi.open_interest.history_aggregated( - `overview` requires `sort` to be `asc` or `desc`; `summary` accepts `topN` between 1 and 30. - `history_aggregated` uses the token id (e.g. `bitcoin`), not a ticker, and accepts `interval` of `5m`, `15m`, `1h`, `4h`, or `1d`. Pass `from_` / `to` as unix-ms (`from_` maps to the wire param `from`). -::: datamaxi.datamaxi.OpenInterest +::: datamaxi.resources.OpenInterest options: show_submodules: true show_source: false diff --git a/docs/premium.md b/docs/premium.md index 34cb05d..346e584 100644 --- a/docs/premium.md +++ b/docs/premium.md @@ -28,7 +28,7 @@ data = maxi.premium( - Use `min_`/`max_` filters to narrow price difference, volume, and funding data. - Set `pandas=False` to return the raw list response. -::: datamaxi.datamaxi.Premium +::: datamaxi.resources.Premium options: show_submodules: true show_source: false diff --git a/tests/test_cex.py b/tests/test_cex.py index 7081816..d67523b 100644 --- a/tests/test_cex.py +++ b/tests/test_cex.py @@ -2,14 +2,14 @@ import responses -from datamaxi.datamaxi.cex import Cex -from datamaxi.datamaxi.cex_candle import CexCandle -from datamaxi.datamaxi.cex_ticker import CexTicker -from datamaxi.datamaxi.cex_fee import CexFee -from datamaxi.datamaxi.cex_wallet_status import CexWalletStatus -from datamaxi.datamaxi.cex_announcement import CexAnnouncement -from datamaxi.datamaxi.cex_token import CexToken -from datamaxi.datamaxi.cex_symbol import CexSymbol +from datamaxi.resources.cex import Cex +from datamaxi.resources.cex_candle import CexCandle +from datamaxi.resources.cex_ticker import CexTicker +from datamaxi.resources.cex_fee import CexFee +from datamaxi.resources.cex_wallet_status import CexWalletStatus +from datamaxi.resources.cex_announcement import CexAnnouncement +from datamaxi.resources.cex_token import CexToken +from datamaxi.resources.cex_symbol import CexSymbol from tests.util import mock_http_response BASE_URL = "https://api.datamaxiplus.com" diff --git a/tests/test_cex_announcement.py b/tests/test_cex_announcement.py index 00ce693..bee2cda 100644 --- a/tests/test_cex_announcement.py +++ b/tests/test_cex_announcement.py @@ -5,7 +5,7 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.cex_announcement import CexAnnouncement +from datamaxi.resources.cex_announcement import CexAnnouncement from datamaxi.error import ClientError, ServerError from tests.util import mock_http_response diff --git a/tests/test_cex_candle.py b/tests/test_cex_candle.py index bcb290e..44367bb 100644 --- a/tests/test_cex_candle.py +++ b/tests/test_cex_candle.py @@ -6,7 +6,7 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.cex_candle import CexCandle +from datamaxi.resources.cex_candle import CexCandle from datamaxi.error import ClientError, ServerError from tests.util import mock_http_response diff --git a/tests/test_cex_fee.py b/tests/test_cex_fee.py index ca1865a..9dbd0a1 100644 --- a/tests/test_cex_fee.py +++ b/tests/test_cex_fee.py @@ -5,7 +5,7 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.cex_fee import CexFee +from datamaxi.resources.cex_fee import CexFee from datamaxi.error import ClientError, ServerError from tests.util import mock_http_response diff --git a/tests/test_cex_symbol.py b/tests/test_cex_symbol.py index d0038d9..762ceb8 100644 --- a/tests/test_cex_symbol.py +++ b/tests/test_cex_symbol.py @@ -5,7 +5,7 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.cex_symbol import CexSymbol +from datamaxi.resources.cex_symbol import CexSymbol from datamaxi.error import ClientError, ServerError from tests.util import mock_http_response diff --git a/tests/test_cex_ticker.py b/tests/test_cex_ticker.py index 0757a2c..f7e4dc2 100644 --- a/tests/test_cex_ticker.py +++ b/tests/test_cex_ticker.py @@ -6,7 +6,7 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.cex_ticker import CexTicker +from datamaxi.resources.cex_ticker import CexTicker from datamaxi.error import ClientError, ServerError from tests.util import mock_http_response diff --git a/tests/test_cex_token.py b/tests/test_cex_token.py index f6ce5a3..ef80688 100644 --- a/tests/test_cex_token.py +++ b/tests/test_cex_token.py @@ -5,7 +5,7 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.cex_token import CexToken +from datamaxi.resources.cex_token import CexToken from datamaxi.error import ClientError, ServerError from tests.util import mock_http_response diff --git a/tests/test_cex_wallet_status.py b/tests/test_cex_wallet_status.py index 4dc8188..604bb46 100644 --- a/tests/test_cex_wallet_status.py +++ b/tests/test_cex_wallet_status.py @@ -6,7 +6,7 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.cex_wallet_status import CexWalletStatus +from datamaxi.resources.cex_wallet_status import CexWalletStatus from datamaxi.error import ClientError, ServerError from tests.util import mock_http_response diff --git a/tests/test_forex.py b/tests/test_forex.py index 4d60904..5dbf275 100644 --- a/tests/test_forex.py +++ b/tests/test_forex.py @@ -6,7 +6,7 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.forex import Forex +from datamaxi.resources.forex import Forex from datamaxi.error import ClientError, ServerError from tests.util import mock_http_response diff --git a/tests/test_funding_rate.py b/tests/test_funding_rate.py index 9e383d3..04a307c 100644 --- a/tests/test_funding_rate.py +++ b/tests/test_funding_rate.py @@ -6,7 +6,7 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.funding_rate import FundingRate +from datamaxi.resources.funding_rate import FundingRate from datamaxi.error import ClientError, ServerError from tests.util import mock_http_response diff --git a/tests/test_index_price.py b/tests/test_index_price.py index c60b514..fcf165c 100644 --- a/tests/test_index_price.py +++ b/tests/test_index_price.py @@ -5,7 +5,7 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.index_price import IndexPrice +from datamaxi.resources.index_price import IndexPrice from datamaxi.error import ParameterRequiredError from tests.util import mock_http_response diff --git a/tests/test_liquidation_open_interest.py b/tests/test_liquidation_open_interest.py index 203bd2e..89d256d 100644 --- a/tests/test_liquidation_open_interest.py +++ b/tests/test_liquidation_open_interest.py @@ -9,8 +9,8 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.liquidation import Liquidation -from datamaxi.datamaxi.open_interest import OpenInterest +from datamaxi.resources.liquidation import Liquidation +from datamaxi.resources.open_interest import OpenInterest from datamaxi.error import ClientError, ServerError from tests.util import mock_http_response diff --git a/tests/test_margin_borrow.py b/tests/test_margin_borrow.py index 31b7aa8..38ab099 100644 --- a/tests/test_margin_borrow.py +++ b/tests/test_margin_borrow.py @@ -5,7 +5,7 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.margin_borrow import MarginBorrow +from datamaxi.resources.margin_borrow import MarginBorrow from datamaxi.error import ParameterRequiredError from tests.util import mock_http_response diff --git a/tests/test_premium.py b/tests/test_premium.py index 16787b7..eab3d1c 100644 --- a/tests/test_premium.py +++ b/tests/test_premium.py @@ -6,7 +6,7 @@ import pytest from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.premium import Premium +from datamaxi.resources.premium import Premium from datamaxi.error import ClientError, ServerError from tests.util import mock_http_response diff --git a/tests/test_query_params.py b/tests/test_query_params.py index 73c2762..eb843b6 100644 --- a/tests/test_query_params.py +++ b/tests/test_query_params.py @@ -11,8 +11,8 @@ import responses from urllib.parse import urlparse, parse_qs -from datamaxi.datamaxi.liquidation import Liquidation -from datamaxi.datamaxi.open_interest import OpenInterest +from datamaxi.resources.liquidation import Liquidation +from datamaxi.resources.open_interest import OpenInterest BASE_URL = "https://api.datamaxiplus.com"